You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to suggest adding two new sniffs around the usage of preg_quote().
Verify the $regex parameter of any PCRE function calls to make sure that if the regex is being build up by concatenating parts together, that any $variable parts are wrapped in a call to preg_quote().
Verify that the optional second parameter $delimiter of preg_quote() is always passed.
Too often I come across code where it is missing and unless it is passed, the default / delimiters are presumed, which is often wrong.
Initially these sniffs would go into Extra, but I'd encourage the WP Core team to consider accepting them into the Core ruleset.
Opinions ?
The text was updated successfully, but these errors were encountered:
Originally suggested in WordPress/WordPress-Coding-Standards#1371:
The text was updated successfully, but these errors were encountered: