Permalink
Browse files

Fixes #2745.

  • Loading branch information...
1 parent 0289b27 commit 58215675eab35af284fd2d2312aba0b814e30805 @demonkoryu committed Oct 16, 2012
Showing with 29 additions and 2 deletions.
  1. +29 −2 library/Zend/Http/Client.php
@@ -113,6 +113,7 @@ class Client implements Stdlib\DispatchableInterface
'keepalive' => false,
'outputstream' => false,
'encodecookies' => true,
+ 'argseparator' => null,
'rfc3986strict' => false
);
@@ -356,6 +357,32 @@ public function getMethod()
}
/**
+ * Set the query string argument separator
+ *
+ * @param string $argSeparator
+ * @return Client
+ */
+ public function setArgSeparator($argSeparator)
+ {
+ $this->setOptions(array("argseparator" => $argSeparator));
+ return $this;
+ }
+
+ /**
+ * Get the query string argument separator
+ *
+ * @return string
+ */
+ public function getArgSeparator()
+ {
+ $argSeparator = $this->options['argseparator'];
+ if (empty($argSeparator)) {
+ $argSeparator = ini_get('arg_separator.output');
+ }
+ return $argSeparator;
+ }
+
+ /**
* Set the encoding type and the boundary (if any)
*
* @param string $encType
@@ -773,14 +800,14 @@ public function send(Request $request = null)
if (!empty($queryArray)) {
$newUri = $uri->toString();
- $queryString = http_build_query($query);
+ $queryString = http_build_query($query, null, $this->getArgSeparator());
if ($this->config['rfc3986strict']) {
$queryString = str_replace('+', '%20', $queryString);
}
if (strpos($newUri, '?') !== false) {
- $newUri .= '&' . $queryString;
+ $newUri .= $this->getArgSeparator() . $queryString;
} else {
$newUri .= '?' . $queryString;
}

0 comments on commit 5821567

Please sign in to comment.