[pmwiki-users] Incorrect URL with ?action=something
Patrick R. Michaud
pmichaud at pobox.com
Tue Apr 19 17:43:20 CDT 2005
On Wed, Apr 20, 2005 at 12:00:12AM +0200, Hochstrasser Benedikt wrote:
> I am currently exploring pmwiki2-beta32 on BRS WebWeaver (testing) or
> Apache/mini_httpd (productive).
>
> I noticed that the 'action' argument is always attached to the url via
> "?action=something", regardless whether PATH_INFO was used or not, eg.
> http://localhost/pmwiki-2.0.beta32/pmwiki.php?n=Main.SideBar?action=edit
>
> This will fail miserably because [at least] BRS will happily report that
> the QUERY_STRING was "n=Main.SideBar", ie it simply chops off the
> trailing
> 2nd argument. (I don't know what the RFCs say about how-to-treat cgi
> urls with two question marks)
The RFCs say it's perfectly legal. From RFC 3986 [1], section 3.4:
... The query component is indicated by the
first question mark ("?") character and terminated by a
number sign ("#") character or by the end of the URI.
query = *( pchar / "/" / "?" )
The characters slash ("/") and question mark ("?") may represent
data within the query component. ...
[1] http://www.ietf.org/rfc/rfc3986.txt
Of course, I did it this way so that PmWiki (and authors) don't have
to decide whether to use '&' or '?' to add a query component to
the string -- they can always use '?' and PmWiki knows how to deal
with the result. Of course, if the webserver is broken, well...
Now then, I did check RFC 2396 (the predecessor to RFC 3986), and
although it says there that '?' is reserved within a query component
there were other items mentioned in that document that led me to
believe that an unencoded '?' is acceptable in the query string.
Pm
More information about the pmwiki-users
mailing list