API: double-encode percent symbols when normalizing parameters

This commit is contained in:
Max Rice 2014-04-03 16:56:26 -04:00
parent 853520d40b
commit 1c437bdeb8
1 changed files with 5 additions and 1 deletions

View File

@ -250,7 +250,11 @@ class WC_API_Authentication {
foreach ( $parameters as $key => $value ) {
$normalized_parameters[ rawurlencode( rawurldecode( $key ) ) ] = rawurlencode( rawurldecode( $value ) );
// percent symbols (%) must be double-encoded
$key = str_replace( '%', '%25', rawurlencode( rawurldecode( $key ) ) );
$value = str_replace( '%', '%25', rawurlencode( rawurldecode( $value ) ) );
$normalized_parameters[ $key ] = $value;
}
return $normalized_parameters;