Re: Why is the default value for arg_separator.output '&'?
| From: | Jochem Maas | Date: | Wed, 20 Apr 2005 18:37:54 +0000 |
| Subject: | Re: Why is the default value for arg_separator.output '&'? | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-213525@lists.php.net to get a copy of this message | ||
David Dorward wrote:
Richard Lynch wrote:you might be able to put this func to use somewhere: function properAmpersands($url) {But if it's going to break a billion scripts, it's probably not gonna happen to follow a "standard" that isn't the only game in town. XHTML is not ubiquitous. [shrug]Representing & characters as & has been a requirement of SGML and XML based languages, HTML included, since long before XHTML appeared on the scene.
return preg_replace("/(&)(?!amp;)/","&",(string)$url);
}
What scripts would making this change be likely to break? I have difficulty believing it could cause problems for other then a very small proprotion of users - unlike the change in register_globals a few years ago.Since there are still browsers in use that will choke on & in the URL, last time I checked, you're pretty much fighting for a lost cause, as far as I'm concerned.We aren't talking about "in the URL", we're talking about "in the href attribute". Browsers convert & in HTML documents (including in href attributes) to & before they think about them being part of URLs. Can you name any browser that gets it wrong? I stress that typing http://www.example.com/?foo=bar&baz=baa into the address bar is not how the issue should be tested.