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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri May 17 12:01:32 2024 UTC