[thelist] REFC Delimiter

Andrew Clover and at doxdesk.com
Fri Apr 26 15:20:00 CDT 2002


Eric D Means <eric.d.means at boeing.com> wrote:

> You would have to get PHP to rewrite URLs with escaped ampersands in order
> for URL rewriting to validate, which is what he's asking about.

This is PHP bug 14653, about which yohgaki at php.net says:

  Of course we know the default is not correct.
  We just use legacy one for compatibility.

Of course this makes no sense, since the only browsers that don't decode
&amp; to & before use are ancient and decrepit. Contrary to the claim in
that bug report, Netscape 3 *does* understand it properly.

And in any case, any standards-compliant url-decoder would read an
incorrectly submitted query string, eg.

  blah.php?foo=1&amp;bar=2

as the two intended parameters 'foo' and 'bar', and one malformed
parameter 'amp' which can be ignored. So changing the default to '&amp;'
would solve the problem (which is worse than just validation - look what
happens if one of your parameters is called 'sect' or any other valid
entity name now or in the future), and it would hurt nobody.

It would be easiest just to use ';' instead though. HTML says this can
be used as a seperator instead of an ampersand, and PHP already supports
that.

You can fix this yourself if you have access to the php.ini. Change the line:

  arg_separator.output = "&amp;"

to:

  arg_separator.output = ";"

--
Andrew Clover
mailto:and at doxdesk.com
http://and.doxdesk.com/



More information about the thelist mailing list