@@ -115,7 +115,6 @@ protected function nonce():string{
115115 $ nonce = random_bytes (32 );
116116
117117 // use the sodium extension if available
118- /** @noinspection PhpComposerExtensionStubsInspection */
119118 return function_exists ('sodium_bin2hex ' ) ? sodium_bin2hex ($ nonce ) : bin2hex ($ nonce );
120119 }
121120
@@ -175,9 +174,9 @@ public function getAccessToken(string $token, string $verifier):AccessToken{
175174 * @return \Psr\Http\Message\RequestInterface
176175 */
177176 public function getRequestAuthorization (RequestInterface $ request , AccessToken $ token ):RequestInterface {
178- $ u = $ request ->getUri ();
177+ $ uri = $ request ->getUri ();
179178
180- parse_str ($ u ->getQuery (), $ p );
179+ parse_str ($ uri ->getQuery (), $ query );
181180
182181 $ parameters = [
183182 'oauth_consumer_key ' => $ this ->options ->key ,
@@ -188,7 +187,12 @@ public function getRequestAuthorization(RequestInterface $request, AccessToken $
188187 'oauth_version ' => '1.0 ' ,
189188 ];
190189
191- $ parameters ['oauth_signature ' ] = $ this ->getSignature ((string )$ u ->withQuery ('' )->withFragment ('' ), array_merge ($ p , $ parameters ), $ request ->getMethod (), $ token ->accessTokenSecret );
190+ $ parameters ['oauth_signature ' ] = $ this ->getSignature (
191+ (string )$ uri ->withQuery ('' )->withFragment ('' ),
192+ array_merge ($ query , $ parameters ),
193+ $ request ->getMethod (),
194+ $ token ->accessTokenSecret
195+ );
192196
193197 return $ request ->withHeader ('Authorization ' , 'OAuth ' .Psr7 \build_http_query ($ parameters , true , ', ' , '" ' ));
194198 }
0 commit comments