diff --git a/lib/Github/Api/AbstractApi.php b/lib/Github/Api/AbstractApi.php index a9204787659..d4d501ed3ec 100644 --- a/lib/Github/Api/AbstractApi.php +++ b/lib/Github/Api/AbstractApi.php @@ -103,7 +103,7 @@ protected function get($path, array $parameters = [], array $requestHeaders = [] } if (count($parameters) > 0) { - $path .= '?'.http_build_query($parameters); + $path .= '?'.http_build_query($parameters, '', '&', PHP_QUERY_RFC3986); } $response = $this->client->getHttpClient()->get($path, $requestHeaders); @@ -126,7 +126,7 @@ protected function head($path, array $parameters = [], array $requestHeaders = [ unset($parameters['ref']); } - return $this->client->getHttpClient()->head($path.'?'.http_build_query($parameters), $requestHeaders); + return $this->client->getHttpClient()->head($path.'?'.http_build_query($parameters, '', '&', PHP_QUERY_RFC3986), $requestHeaders); } /** diff --git a/lib/Github/HttpClient/Plugin/Authentication.php b/lib/Github/HttpClient/Plugin/Authentication.php index a70593b8791..669fb1d8965 100644 --- a/lib/Github/HttpClient/Plugin/Authentication.php +++ b/lib/Github/HttpClient/Plugin/Authentication.php @@ -69,7 +69,7 @@ public function doHandleRequest(RequestInterface $request, callable $next, calla ]; $query .= empty($query) ? '' : '&'; - $query .= utf8_encode(http_build_query($parameters, '', '&')); + $query .= utf8_encode(http_build_query($parameters, '', '&', PHP_QUERY_RFC3986)); $uri = $uri->withQuery($query); $request = $request->withUri($uri);