From 6458762e4af666c6edf63f369d12d96ad0ee44c4 Mon Sep 17 00:00:00 2001 From: Pierre Martin Date: Thu, 13 Jun 2019 17:20:27 +0200 Subject: [PATCH] fix(oauth): sort parameters in a standard way as per the specs the signature is now calculated a bit differently to match other implementations. BREAKING CHANGE: existing OAuth applications may encounter some issues leading to `invalid_signature` 401 errors from Magento due to the removal of natural sorting for parameters when generating the signature --- lib/Zend/Oauth/Signature/SignatureAbstract.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Zend/Oauth/Signature/SignatureAbstract.php b/lib/Zend/Oauth/Signature/SignatureAbstract.php index d04f7f40b14..5dea6a0fe74 100644 --- a/lib/Zend/Oauth/Signature/SignatureAbstract.php +++ b/lib/Zend/Oauth/Signature/SignatureAbstract.php @@ -167,7 +167,7 @@ protected function _getBaseSignatureString(array $params, $method = null, $url = protected function _toByteValueOrderedQueryString(array $params) { $return = array(); - uksort($params, 'strnatcmp'); + ksort($params); foreach ($params as $key => $value) { if (is_array($value)) { natsort($value);