Skip to content

Commit b456ddf

Browse files
committed
Fix parseQuery() method
If there is more than two variables in the query string with the same name, the corresponding array is not well formatted which causes an error in the function urlencode of the method buildQuery().
1 parent 7b7030e commit b456ddf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Google/Http/Request.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,8 +384,10 @@ private function parseQuery($string)
384384
list($key, $value) = explode('=', $part, 2);
385385
$value = urldecode($value);
386386
if (isset($return[$key])) {
387-
$return[$key] = array($return[$key]);
388-
$return[$key][] = $value;
387+
if (!is_array($return[$key])) {
388+
$return[$key] = array($return[$key]);
389+
}
390+
$return[$key][] = $value;
389391
} else {
390392
$return[$key] = $value;
391393
}

0 commit comments

Comments
 (0)