From 5e3825130863067b49698b6095f22bce5c857959 Mon Sep 17 00:00:00 2001 From: "Thiago B. Negri" Date: Sat, 29 Aug 2015 17:38:32 -0300 Subject: [PATCH] Fix signature for params with special chars Parameters with special characters that needs encoding should be encoded twice: 1. Encode as they are part of a URL, so they must be encoded; 2. Encode to join as the base string for signature. See #34 --- lib/class-wp-json-authentication-oauth1.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/class-wp-json-authentication-oauth1.php b/lib/class-wp-json-authentication-oauth1.php index 3a0612f..4dae646 100644 --- a/lib/class-wp-json-authentication-oauth1.php +++ b/lib/class-wp-json-authentication-oauth1.php @@ -624,7 +624,7 @@ public function join_with_equals_sign( $params, $query_params = array(), $key = if ( $key ) { $param_key = $key . '[' . $param_key . ']'; // Handle multi-dimensional array } - $string = $param_key . '=' . $param_value; // join with equals sign + $string = urlencode( $param_key ) . '=' . urlencode( $param_value ); // join with equals sign $query_params[] = urlencode( $string ); } }