[pmwiki-users] beta29 + newpageform.php = bug?

Patrick R. Michaud pmichaud at pobox.com
Tue Apr 12 12:11:16 CDT 2005


On Tue, Apr 12, 2005 at 06:20:11PM +0200, Laurent Meister wrote:
> you wanted bug reports? 

I'm always interested in bug reports.  :-)

> So here is maybe one. I've updated our pmwiki 
> this morning. Everything works fine, maybe because we have no user 
> authentication yet. But I noticed a problem with a script I wrote. The 
> newpageform.php. It always posts the "new page" on the formpage. :-/
> 
> Is someone else of the mailinglist using the script and noticing 
> similar behavior?
> 
> The problem must be here around:
> 
> if ($action=='postnewpage') {
> $pagename = "{$_REQUEST ['group']}."."{$_REQUEST ['newpagename']}";
> 
> Does the changes you've done have some effects on $_REQUEST?

Well, as far as I can tell nothing I did should've affected $_REQUEST
in any way.  But I've gone through the newpageform.php code and
have some observations...

 - There's a possible bug on line 108, which reads
           <td><input type='text' name='group'value='Main'></td></tr>";
   and probably needs a space between name='group' and value.  This
   might be the source of the problem.

 - The HandleEdit function primarily looks for the 'post' control in 
   $_POST, not in $_REQUEST.  (I think there's a bug in SaveAttributes()
   that is still looking in $_REQUEST['post'], but $_POST['post'] is 
   the correct/desired variable.)  

 - In fact, in looking at it I'm not sure what you're expecting
          $_REQUEST['post'] = 1;
   to do -- normally this would cause PmWiki to immediately save the
   page (if it can) without displaying another edit form.  It normally
   would bypass the $EditMessageFmt that follows.

Pm



More information about the pmwiki-users mailing list