From 30c1486aa77603e2cfd07687f11e9beebebe8df4 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Fri, 14 Feb 2014 13:26:31 +0200 Subject: [PATCH] REST API OAuth signature issue fix when using filter params --- includes/api/class-wc-api-authentication.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/api/class-wc-api-authentication.php b/includes/api/class-wc-api-authentication.php index 22ed5eebd95..d3a6c6d2a5f 100644 --- a/includes/api/class-wc-api-authentication.php +++ b/includes/api/class-wc-api-authentication.php @@ -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' ) );