PHPoAuthLib
PHPoAuthLib copied to clipboard
Failure to generate correct signature with array style query params
PHP 5.5.15 (cli) (built: Jul 31 2014 13:41:26) OSX
Signatures are not generated correctly when query params are in the array style, using square brackets.
Example (Magento REST api):
api/rest/products?filter[1][attribute]=entity_id&filter[1][neq]=3
A Warning is issued:
PHP Warning: rawurlencode() expects parameter 1 to be string, array given in ... OAuth1/Signature/Signature.php on line 63
And the resulting signature is incorrect.
The reason is that parse_str()
(Signature.php#59) will unpack the query into a multidimensional array, whereas the following code is expecting each item to be a string.
Can you reproduce the error on my fork?
https://github.com/Dragonqos/PHPoAuthLib/commit/8c6f1afb649217ae4dbadb8288a207d7da9ef740 this commit may help to resolve issue