Prevent an error in WP 4.9.12 from field sanitization#39
Merged
Conversation
…error There was a PHP error when that function accepted a closure, and in 4.9.12, it didn't have a check that exits if the argument is the wrong type. So move the check into a function that later calls sanitize_text_field().
Contributor
Author
|
Request For Review Hi @dugajean, Thanks, Dugi! |
parabrola
approved these changes
Jan 30, 2020
Contributor
parabrola
left a comment
There was a problem hiding this comment.
Looks very good! Thanks Ryan 😄
Contributor
Author
|
Thanks, Dugi! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Steps to reproduce
wp core update --version=4.9.12 --force7.3if you canBackground
This error is from:
cloudinary_wordpress/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/class-settings-page.php
Line 415 in 9b10a98
One of the values that is passed to
sanitize_text_field()is:sanitize_text_fieldpasses that to_sanitize_text_fields(). That's not a problem in WP 5.0+, I think. It now exits for values like closures.But in WP 4.9, it didn't yet check the type, and it caused the error here.
This PR should back-port the WP 5.0 functionality to 4.9. There's no expected change in behavior in WP 5.0+.
But this could use good regression testing on the 'Global Transformations' screens, like at /wp-admin/admin.php?page=cld_global_transformation&tab=global_video_transformations