[pmwiki-users] intermittent suspected ParseArgs error when processing SelectQuery

Ben Stallings Ben at InterdependentWeb.com
Wed Oct 25 09:35:29 CDT 2006


Hi, folks.  I've been contacted by a member of the Tararua Tramping Club 
in Australia regarding a problem s/he's having with a SelectQuery.  It's 
generating an error in line 348 of pmwiki.php, and I haven't had a 
chance to see their copy of pmwiki.php yet, so I'm not 100% sure what 
line that is, but my best guess is that it falls inside the ParseArgs 
function, which is called by selectquery.php.

The funny thing about the error is that if you edit the page, make any 
change whatsoever and save it, the error goes away in your browser.  Not 
in other browsers, just the one where you made the change.  It's as if 
something is getting cached in the browser during the editing process.

The problematic tag is,
(:selectquery columns="Date_Format(`Activity_Start_Date`,'%e %M') as 
'Date',`Activity_Description` as 'Description'" tables=activity 
where="Activity_Start_Date>=Curdate()" order="Activity_Start_Date":)

This is already pared back compared to what he had when he contacted me, 
but I pared it back as far as
(:selectquery columns=Activity_Start_Date,Activity_Description 
tables=activity where=1 order=Activity_Start_Date:)

and the error still occurred, so the problem is not with quotes or other 
punctuation... yet it only occurs on pages with SelectQuery.  The error 
it generates is,

Warning: Invalid argument supplied for foreach() in 
/opt/lampp/htdocs/ttc/pmwiki/pmwiki.php on line 348

My guess is that what's on line 348 of their pmwiki.php is this meaty 
bit of ParseArgs():

   preg_match_all('/([-+]|(?>(\\w+)[:=]))?("[^"]*"|\'[^\']*\'|\\S+)/',
     $x, $terms, PREG_SET_ORDER);
   foreach($terms as $t) {

Any ideas?  Thanks in advance. --Ben




More information about the pmwiki-users mailing list