php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28319 Query string parsing not respecting semicolon as a delimiter
Submitted: 2004-05-07 19:51 UTC Modified: 2004-05-07 19:54 UTC
From: nick at careercast dot com Assigned:
Status: Not a bug Package: CGI/CLI related
PHP Version: 4.3.4 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nick at careercast dot com
New email:
PHP Version: OS:

 

 [2004-05-07 19:51 UTC] nick at careercast dot com
Description:
------------
W3C spec indicates that valid separators for name value pairs are "&" and ";". 

http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.2

"We recommend that HTTP server implementors, and in particular, CGI implementors support the use of ";" in place of "&" to save authors the trouble of escaping "&" characters in this manner."

This becomes an issue when you are dealing with xml/xsl/xhtml, because you can no longer use:

http://host/script.php?var1=bob&var2=jim

instead, you have to use:

http://host/script.php?var1=bob&var2=jim

PHP should follow the W3C recommendation and support ";" as a delimiter for name/value pairs in URLs

Reproduce code:
---------------
<xmp>
<?php

print_r ($_GET);

?>
</xmp>

And then call this script with this query string:
?var1=bob;var2=jim

Expected result:
----------------
Array
(
    [var1] => bob
    [var2] => jim
)

Actual result:
--------------
Array
(
    [var1] => bob;var2=jim
)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-10-19 07:11 UTC] kaldari at gmail dot com
Why is this bug marked as "Bogus"?
 [2010-10-19 07:28 UTC] kaldari at gmail dot com
Ah, I found it. It's because you can set the arg separator used by PHP with the arg_separator.input directive in your php.ini file. The URL above is broken, by the way, which is why this wasn't evident.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 00:01:34 2025 UTC