Skip to content

Commit 2fa3e46

Browse files
authored
Fix for deprecated function in http_build_query
Exception Message in PHP8: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated *Update all functions
1 parent 5c8d02f commit 2fa3e46

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/OAuth2/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function getAuthenticationUrl($auth_endpoint, $redirect_uri, array $extra
196196
'client_id' => $this->client_id,
197197
'redirect_uri' => $redirect_uri
198198
), $extra_parameters);
199-
return $auth_endpoint . '?' . http_build_query($parameters, null, '&');
199+
return $auth_endpoint . '?' . http_build_query($parameters, '', '&');
200200
}
201201

202202
/**
@@ -373,7 +373,7 @@ private function generateMACSignature($url, $parameters, $http_method)
373373
}
374374
if ($http_method == self::HTTP_METHOD_GET) {
375375
if (is_array($parameters)) {
376-
$parsed_url['path'] .= '?' . http_build_query($parameters, null, '&');
376+
$parsed_url['path'] .= '?' . http_build_query($parameters, '', '&');
377377
} elseif ($parameters) {
378378
$parsed_url['path'] .= '?' . $parameters;
379379
}
@@ -422,7 +422,7 @@ private function executeRequest($url, $parameters = array(), $http_method = self
422422
* http://php.net/manual/en/function.curl-setopt.php
423423
*/
424424
if(is_array($parameters) && self::HTTP_FORM_CONTENT_TYPE_APPLICATION === $form_content_type) {
425-
$parameters = http_build_query($parameters, null, '&');
425+
$parameters = http_build_query($parameters, '', '&');
426426
}
427427
$curl_options[CURLOPT_POSTFIELDS] = $parameters;
428428
break;
@@ -432,7 +432,7 @@ private function executeRequest($url, $parameters = array(), $http_method = self
432432
case self::HTTP_METHOD_DELETE:
433433
case self::HTTP_METHOD_GET:
434434
if (is_array($parameters) && count($parameters) > 0) {
435-
$url .= '?' . http_build_query($parameters, null, '&');
435+
$url .= '?' . http_build_query($parameters, '', '&');
436436
} elseif ($parameters) {
437437
$url .= '?' . $parameters;
438438
}

0 commit comments

Comments
 (0)