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
FYI: I've been working on a comprehensive sniff regarding the Filter extension as there are quite some gotcha's when working with it.
This new sniff addresses the issues the PHPFilterFunctions sniff looks for, as well as other things, partially based on a deep dive by me into the filter extension and partially based on other issues related to the extension which I've seen in the WPCS and YoastCS repos.
Some examples:
Warn about the filter_input*() functions acting on the original input received from the browser, not the current value.
Warn about certain INPUT_* constants not always being available.
Warn when the FILTER_* constants aren't used (like when integers are used instead).
etc
The sniff needs a release of PHPCSUtils (alpha 4) before I can pull it. I intend to pull the sniff to PHPCSExtra as it is a CMS agnostic sniff which is generically useful and usable for any PHP project.
Once the sniff has been merged, I will recommend for the sniff to be added to the WordPress-Extra ruleset.
As for VIPCS, I'd suggest replacing the current sniff with the sniff from PHPCSExtra. If needs be, the additional checks in the sniff can be silenced. Then again, you may like what you see ;-)
Review the
WordPressVIPMinimum.Security.PHPFilterFunctions
sniff for the following in as far as relevant to that sniff:Typical things to add tests for and verify correct handling of:
list
statementsTypical things to add tests for and verify correct handling of (where applicable):
::class
use function/const
Other:
Sniff basics, but changes need to be lined up for next major release:
public
properties (Audit Public Sniff Properties #234)Once PHPCS/PHPCSUtils supports this:
match
expressionsThe text was updated successfully, but these errors were encountered: