ID: 45350
User updated by: jon at phpsitesolutions dot com
Reported By: jon at phpsitesolutions dot com
-Status: Open
+Status: Closed
Bug Type: *URL Functions
Operating System: Linux 2.6.9-67.0.7.ELsmp #1 SMP
PHP Version: 5.2.6
New Comment:
Just a note, the sample code I submitted, references "$qs", should be
"$query_string".
Additionally, the sample doesn't reproduce the error. This does:
<?php
$query_string = 'mode=order_message&orderids=5048';
parse_str(html_entity_decode($query_string), $query_string);
$var = http_build_query($query_string, null, '');
echo $var;
?>
It appears this is probably an expected behavior, so it looks like I'll
just have to work around it.
Thanks
Previous Comments:
------------------------------------------------------------------------
[2008-06-24 18:26:19] jon at phpsitesolutions dot com
Description:
------------
When using http_build_query, passing an empty 3rd parameter results in
no separator being used in the resulting output.
This is incorrect, as the documentation page specifies that
'arg_separator.output' will be used in the event that the 3rd parameter
is empty.
To fix this issue in my scripts, I've had to explicitly define the
separator to use, using:
$sep = ini_get('arg_separator.output');
Reproduce code:
---------------
<?php
$query_string = 'mode=order_message&orderids=5048';
parse_str(html_entity_decode($qs), $query_string);
$var = http_build_query($query_string);
echo $var;
?>
Expected result:
----------------
'mode=order_message&orderids=5048'
Actual result:
--------------
'mode=order_messageorderids%3D5048'
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=45350&edit=1