-
Notifications
You must be signed in to change notification settings - Fork 112
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
PHP 8.0 warning thrown by normalize_parameters #223
Comments
Proper callback should look like this:
|
Are you sure you have the params in the correct order? Previously, it was $key first, $value second: https://github.com/WP-API/OAuth1/blob/master/lib/class-wp-rest-oauth1.php#L754 |
Params order is fine, normalize_parameters is called here:
according to PHP docs https://www.php.net/manual/en/function.array-walk-recursive.php: So declaration of normalize_parameters function in:
it should:
also there's no need to pass $key by reference and normalize it because any $key changes won't be made in array. |
But if you change the order of the params in the function definition, don't you need to also change their order when calling the function? Maybe in this case you don't, because of the way array_walk_recursive() works, but I can't quite make out why. The code is a bit overly clever :D |
No you don't need to change order of params passed because there is only one param ($params is an array). |
Thank you for the response. It makes sense now. As an aside -- I still use and depend on this plugin heavily. Obviously it is completely abandoned. I don't understand what the replacement for it was. Do you? |
I think this is the preferred way now https://make.wordpress.org/core/2020/11/05/application-passwords-integration-guide/. |
Will there be an update here: https://wordpress.org/support/plugin/rest-api-oauth1/ ? |
After switching from PHP 7.4 to 8.0 a warning is thrown:
[16-Dec-2020 10:43:09 UTC] PHP Warning: WP_REST_OAuth1::normalize_parameters(): Argument #2 ($value) must be passed by reference, value given in /.../wp-content/plugins/rest-api-oauth1/lib/class-wp-rest-oauth1.php on line 672
The text was updated successfully, but these errors were encountered: