Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strtr Error #91

Open
pittishgunner opened this issue Jun 12, 2019 · 2 comments
Open

strtr Error #91

pittishgunner opened this issue Jun 12, 2019 · 2 comments

Comments

@pittishgunner
Copy link

RequestValidator -> validateHmac errors out when there is an array in the query params
eg: &ids%5B%5D=1125508776045
image

@pittishgunner
Copy link
Author

pittishgunner commented Jun 12, 2019

As per: https://community.shopify.com/c/Shopify-APIs-SDKs/HMAC-verification-issues/m-p/201515/highlight/true#M9442
Instead of
$pairs[] = $key . '=' . $value;
we should have
if (is_array($value)) { $pairs[] = $key . '=["' . implode(", ", $value) . '"]'; } else { $value = strtr($value, ['&' => '%26', '%' => '%25']); $pairs[] = $key . '=' . $value; }

@bakura10
Copy link
Member

Hi,

This is very interesting. Could you please submit a PR, including unit tests to validate the approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants