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:
parent
43b0ba34e4
commit
0506a231ec
13
src/Api.php
13
src/Api.php
@ -223,11 +223,16 @@ class Api
|
||||
|
||||
if (isset($content) && $method == 'GET') {
|
||||
|
||||
$queryString = $request->getUri()->getQuery();
|
||||
$query_string = $request->getUri()->getQuery();
|
||||
|
||||
$query = false !== strpos($queryString, '&')
|
||||
? explode('&', $queryString)
|
||||
: [];
|
||||
$query = array();
|
||||
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 = \GuzzleHttp\Psr7\build_query($query);
|
||||
|
Loading…
Reference in New Issue
Block a user