Page 1 of 1

problem with serendipity_event_entrypaging

Posted: Wed Sep 07, 2005 12:39 pm
by Frandy
Hi,

I got a strange message in my page using prev/next entries links :

Warning: sprintf() [function.sprintf]: Too few arguments in /blog/plugins/serendipity_event_entrypaging/serendipity_event_entrypaging.php on line 158

Warning: sprintf() [function.sprintf]: Too few arguments in /blog/plugins/serendipity_event_entrypaging/serendipity_event_entrypaging.php on line 159

i add a look into serendipity_event_entrypaging.php

Code: Select all

            $prevID = serendipity_db_query(sprintf($querystring, '<', 'DESC'));
            $nextID = serendipity_db_query(sprintf($querystring, '>', 'ASC'));
could you explain what's happening please ?

thanks for help

Frandy

Posted: Wed Sep 07, 2005 1:07 pm
by Frandy
Now it works !

very strange.

Posted: Wed Sep 07, 2005 1:15 pm
by wesley
It's hinting that something's wrong with $querystring being passed to here...
Although there SHOULDN'T be. Perhaps a loophole? It would've been nice
to capture what was in $querystring when the error occurred.

Posted: Wed Sep 07, 2005 1:36 pm
by Frandy
wesley wrote:It's hinting that something's wrong with $querystring being passed to here...
Although there SHOULDN'T be. Perhaps a loophole? It would've been nice
to capture what was in $querystring when the error occurred.
I can repeat the problem
it appends only when i'm connected as an admin user to the blog with some specific entries hidden to other users. i can read these 'protected' entries but the error is on.

when i'm connected as a visitor, sure i can't see hidden entries but the problem doesn't appear.

have an idea ?
how can i help you ?

Posted: Wed Sep 07, 2005 6:11 pm
by garvinhicking
Thanks for debugging this.

In fact the problem was caused because once entryproperties plugin is active, it inserts SQL parts like

Code: Select all

LIKE '%serendipity...%'
into the $querystring varaible. Sprintf() now thinks that the "%s" is yet another string which needs parametrization.

Thus we now need to to our own string replacement which doesn't cat %s as an evil character.

( That means: Fixed in CVS, version 1.19 of the plugin :-) )

Regards,
Garvin

Posted: Wed Sep 07, 2005 7:35 pm
by Frandy
Great :lol: