From: jon at phpsitesolutions dot com
Operating system: Linux 2.6.9-67.0.7.ELsmp #1 SMP
PHP version: 5.2.6
PHP Bug Type: *URL Functions
Bug description: http_build_query - when 3rd parameter is empty, an empty
separator is used
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 bug report at http://bugs.php.net/?id=45350&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=45350&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=45350&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=45350&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=45350&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=45350&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=45350&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=45350&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=45350&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=45350&r=support
Expected behavior: http://bugs.php.net/fix.php?id=45350&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=45350&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=45350&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=45350&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=45350&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=45350&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=45350&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=45350&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=45350&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=45350&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=45350&r=mysqlcfg