Bug #72617 [Opn->Fbk]: http_build_query http_build_query incorrectly converts a string

From: Date: Mon, 18 Jul 2016 18:45:52 +0000
Subject: Bug #72617 [Opn->Fbk]: http_build_query http_build_query incorrectly converts a string
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202405@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72617&edit=1

 ID:                 72617
 Updated by:         cmb@php.net
 Reported by:        htc dot tolya at gmail dot com
 Summary:            http_build_query http_build_query incorrectly
                     converts a string
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            *URL Functions
 Operating System:   ANY
 PHP Version:        Irrelevant
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

Usually, this should work fine, see <https://3v4l.org/KS61j>.

What is the value of your ini setting of arg_separator.output[1]?
What is your locale?

[1] <http://php.net/manual/en/ini.core.php#ini.arg-separator.output>


Previous Comments:
------------------------------------------------------------------------
[2016-07-18 17:18:05] htc dot tolya at gmail dot com

Description:
------------
http_build_query incorrectly converts a string.

Example.

$url = 'http://site.com/action?';
$url .= http_build_query([
  'param1' => 10,
  'region' => 'en'
]);

P.S>Setting arg_separator (& amp) solves the problem, but this approach does not in all
cases.



Test script:
---------------
$url = 'http://site.com/action?';
$url .= http_build_query([
  'param1' => 10,
  'region' => 'en'
]);
echo $url;

Expected result:
----------------
http://site.com/action?param1=10&region=en

Actual result:
--------------
http://site.com/action?param1=10®ion=en


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=72617&edit=1


Thread (4 messages)

« previous php.bugs (#202405) next »