-
Notifications
You must be signed in to change notification settings - Fork 156
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.1 compatibility: replace FILTER_SANITIZE_STRING #428
Conversation
Per yesterday's bug scrub, @georgestephanis feels the sanitize string is reasonable and could be good to merge, but is not familiar with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not familiar with filter_callback
FILTER_CALLBACK
is documented here, but essentially is a way to ignore the built-in FILTER_*
constants, and set a callback function instead.
not positive if core code style still recommends using array( ) over [ ] shorthand
WPCS still requires longhand array syntax, so that's the code suggestions I've made here.
This looks good! I'll merge this in and some linter checks to find any other PHP8 compatibility issues. |
There was a proposal to change to the short syntax, but the decision was to keep the long one. |
PHP 8.1 deprecated
FILTER_SANITIZE_STRING
. This PR replaces it with other alternatives.Ref: Automattic/vip-go-mu-plugins#2667