-
Notifications
You must be signed in to change notification settings - Fork 85
http_build_query should specify arg separator #33
Comments
I had this same issue today and ended up changing the code locally to work. Calling
would give me a POST body like so:
Expected result should have been: Changing line #1231 to the following fixed the issue:
If "x-www-form-urlencoded" accepts only "&" as a separator (as ameoba32 suggests), then this fix is not the best and "&" should be hard-coded (in case someone has arg_separator.output set in their php.ini file). This issue has existed in this file for quite some time (as I had to make the change on another project over a year ago). It seems like a simple fix...can we do it? |
@redheadedstep Are you willing to provide a pull request with tests for the behavior? I'd certainly review... |
@weierophinney , there is one already #34 |
yes, I saw that pull request. at the moment, I am manually updating my copy of the code, but any new updates overwrite my changes and give me at least a few minutes of wondering why all my curl requests are failing with parameters being passed with & like below :-P
Here is what I have in my copy of Client...which is what pull request #34 does.
Now I'm just waiting for merge for that request #34 that was committed last December. Any love on the ETA? |
This repository has been closed and moved to laminas/laminas-http; a new issue has been opened at laminas/laminas-http#22. |
In http client zendframework/zend-http/src/Client.php:1231 $body request is created using http_build_query function.
$body = http_build_query($this->getRequest()->getPost()->toArray());
Problem is that separator can be changed via ini_set('arg_separator.output', 'some other'); and this will break http client. Since "x-www-form-urlencoded" accepts only "&" as a separator, suggest to hardcode it there.
See similar issue:
https://www.drupal.org/node/2372211
The text was updated successfully, but these errors were encountered: