[Pmwiki-users] Bug with uploads and '?pagename=...' URIs
Christian Ridderström
chr
Wed Jan 28 16:02:18 CST 2004
To illustrate the bug, go to this page:
http://www.lyx.org/~chr/wiki/pmwiki.php?pagename=Main.HomePage&action=upload
and press the 'Upload' button (without selecting a file!). The result
should be this URI (split over two lines):
http://www.lyx.org/~chr/wiki/pmwiki.php?pagename=Main.HomePage
&action=upload&upname=&upresult=nofile
Note the '&' in the beginning of the second row. This results in the
wrong page being displayed once you've pressed the Upload-button since the
action is not recognized as 'upload'.
Tracing what causes this, it starts in HandlePostUpload()@upload.php:
Redirect($pagename,
'$PageUrl?action=upload&upname='.urlencode($UploadName)."&$result\");
where I don't understand how '?action=' is supposed to be converted
into '&action=' since it'll be preceeded by '?pagename='.
Anyway, Redirect()@pmwiki.php then does this:
FmtPageName($urlfmt, $pagename)
where $urlfmt is
'$PageUrl?action=upload&upname='.urlencode($UploadName)."&$result\"
which results in
http://www.lyx.org/~chr/wiki/pmwiki.php?pagename=Main.HomePage
&action=upload&upname=&upresult=nofile
This might be a bug in FmtPageName(), but I'm unable to understand the
details of that function (it could definitely use some comments :-)
/Christian
--
http://www.md.kth.se/~chr
More information about the pmwiki-users
mailing list