two-factor
two-factor copied to clipboard
PHP 8.1 compatibility: replace FILTER_SANITIZE_STRING
PHP 8.1 deprecated FILTER_SANITIZE_STRING
. This PR replaces it with other alternatives.
Ref: Automattic/vip-go-mu-plugins#2667
Per yesterday's bug scrub, @georgestephanis feels the sanitize string is reasonable and could be good to merge, but is not familiar with filter_callback
and not positive if core code style still recommends using array( )
over [ ]
shorthand.
This looks good! I'll merge this in and some linter checks to find any other PHP8 compatibility issues.
WPCS still requires longhand array syntax, so that's the code suggestions I've made here.
There was a proposal to change to the short syntax, but the decision was to keep the long one.