Skip to content

Commit

Permalink
Force & when creating requests.
Browse files Browse the repository at this point in the history
Some people will have entities in arg_seperator.output. Make HttpSocket
more resiliant.

Fixes #3692
  • Loading branch information
markstory committed Mar 14, 2013
1 parent 30247fd commit cec4e8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Cake/Network/Http/HttpSocket.php
Expand Up @@ -328,7 +328,7 @@ public function request($request = array()) {
$this->request['auth'] = $this->_auth;

if (is_array($this->request['body'])) {
$this->request['body'] = http_build_query($this->request['body']);
$this->request['body'] = http_build_query($this->request['body'], '', '&');
}

if (!empty($this->request['body']) && !isset($this->request['header']['Content-Type'])) {
Expand Down Expand Up @@ -696,7 +696,7 @@ protected function _buildUri($uri = array(), $uriTemplate = '%scheme://%user:%pa
}

$uri['path'] = preg_replace('/^\//', null, $uri['path']);
$uri['query'] = http_build_query($uri['query']);
$uri['query'] = http_build_query($uri['query'], '', '&');
$uri['query'] = rtrim($uri['query'], '=');
$stripIfEmpty = array(
'query' => '?%query',
Expand Down

0 comments on commit cec4e8b

Please sign in to comment.