From 1f231453f7e1c699014c0a00b2cc5b21c8c38917 Mon Sep 17 00:00:00 2001 From: mariusz-zajac Date: Tue, 25 Oct 2016 10:21:41 +0200 Subject: [PATCH] Fixed params encoding Wrong encoding cause exception "Signature verification failed (HMAC-SHA1)" for parameters which contains space character (e.g. 2016-10-25 10:19:50). With rawurlencode it works properly. --- src/Shoplo/Resource.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Shoplo/Resource.php b/src/Shoplo/Resource.php index 44fd31c..ae16f31 100755 --- a/src/Shoplo/Resource.php +++ b/src/Shoplo/Resource.php @@ -17,7 +17,7 @@ protected function prepare_params($params) { $string = ''; if (is_array($params)) { - foreach ($params as $k => $v) if (!is_array($v)) $string .= $k . '=' . urlencode($v) . '&'; + foreach ($params as $k => $v) if (!is_array($v)) $string .= $k . '=' . rawurlencode($v) . '&'; $string = substr($string, 0, strlen($string) - 1); } return $string; @@ -75,4 +75,4 @@ public function __destruct() unset($this->client); unset($this->bucket); } -} \ No newline at end of file +}