1
0
mirror of https://github.com/ovh/php-ovh.git synced 2023-11-05 03:20:26 +01:00

fix: incorrect query when passed from url and not from content

Signed-off-by: Romain Beuque <romain.beuque@corp.ovh.com>
This commit is contained in:
Romain Beuque 2016-01-19 15:08:20 +00:00
parent 43b0ba34e4
commit 0506a231ec

View File

@ -223,11 +223,16 @@ class Api
if (isset($content) && $method == 'GET') { if (isset($content) && $method == 'GET') {
$queryString = $request->getUri()->getQuery(); $query_string = $request->getUri()->getQuery();
$query = false !== strpos($queryString, '&') $query = array();
? explode('&', $queryString) if ($query_string != '') {
: []; $queries = explode('&', $query_string);
foreach($queries as $element) {
$key_value_query = explode('=', $element, 2);
$query[$key_value_query[0]] = $key_value_query[1];
}
}
$query = array_merge($query, (array)$content); $query = array_merge($query, (array)$content);
$query = \GuzzleHttp\Psr7\build_query($query); $query = \GuzzleHttp\Psr7\build_query($query);