@@ -557,7 +557,7 @@ protected function check_oauth_signature( $consumer, $oauth_params, $token = nul
557
557
if (substr ($ request_uri_path , 0 , strlen ($ home_url_path )) == $ home_url_path ) {
558
558
$ request_uri_path = substr ($ request_uri_path , strlen ($ home_url_path ));
559
559
}
560
- $ base_request_uri = rawurlencode ( get_home_url ( null , $ request_uri_path ) );
560
+ $ base_request_uri = get_home_url ( null , $ request_uri_path );
561
561
562
562
// get the signature provided by the consumer and remove it from the parameters prior to checking the signature
563
563
$ consumer_signature = rawurldecode ( $ params ['oauth_signature ' ] );
@@ -573,7 +573,7 @@ protected function check_oauth_signature( $consumer, $oauth_params, $token = nul
573
573
$ query_string = $ this ->create_signature_string ( $ params );
574
574
575
575
$ token = (array ) $ token ;
576
- $ string_to_sign = $ http_method . '& ' . $ base_request_uri . '& ' . $ query_string ;
576
+ $ string_to_sign = $ http_method . '& ' . rawurlencode ( $ base_request_uri ) . '& ' . rawurlencode ( $ query_string ) ;
577
577
$ key_parts = array (
578
578
$ consumer ->secret ,
579
579
( $ token ? $ token ['secret ' ] : '' )
@@ -610,7 +610,7 @@ protected function check_oauth_signature( $consumer, $oauth_params, $token = nul
610
610
* @return string Signature string
611
611
*/
612
612
public function create_signature_string ( $ params ) {
613
- return implode ( '%26 ' , $ this ->join_with_equals_sign ( $ params ) ); // join with ampersand
613
+ return implode ( '& ' , $ this ->join_with_equals_sign ( $ params ) ); // join with ampersand
614
614
}
615
615
616
616
/**
@@ -630,8 +630,8 @@ public function join_with_equals_sign( $params, $query_params = array(), $key =
630
630
if ( $ key ) {
631
631
$ param_key = $ key . '[ ' . $ param_key . '] ' ; // Handle multi-dimensional array
632
632
}
633
- $ string = $ param_key . '= ' . $ param_value ; // join with equals sign
634
- $ query_params [] = urlencode ( $ string ) ;
633
+ $ string = rawurlencode ( $ param_key ) . '= ' . rawurlencode ( $ param_value ) ; // join with equals sign
634
+ $ query_params [] = $ string ;
635
635
}
636
636
}
637
637
return $ query_params ;
0 commit comments