REST API OAuth signature issue fix when using filter params

This commit is contained in:
Gerhard 2014-02-14 13:26:31 +02:00 committed by Coen Jacobs
parent a1f12b0382
commit 5c22b36cb7
1 changed files with 9 additions and 0 deletions

View File

@ -184,6 +184,15 @@ class WC_API_Authentication {
$consumer_signature = rawurldecode( $params['oauth_signature'] );
unset( $params['oauth_signature'] );
// remove filters and convert them from array to strings to void normalize issues
if ( isset( $params['filter'] ) ) {
$filters = $params['filter'];
unset( $params['filter'] );
foreach ( $filters as $filter => $filter_value ) {
$params['filter[' . $filter . ']'] = $filter_value;
}
}
// normalize parameter key/values
array_walk( $params, array( $this, 'normalize_parameters' ) );