-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
Add phpcs.xml for safe output functions #225
Comments
This is blocked by WordPress/WordPress-Coding-Standards#413 |
Closing this off as there's been no movement on the PHPCS issue that blocks this and I'm happy enough with the inline comments in the meantime. |
The old WPCS-style whitelist comments were deprecated for WPCS 2.0, and a Warning was introduced if they were found (instead of using the PHPCS native ignore comments instead), so I'm curious why these don't seem to be flagged in your CI run. |
I've got the Lines 53 to 54 in c86893e
|
There are a at least a couple of functions (
build_sorter()
,build_filter()
) that are deemed safe for output, which are marked with a// WPCS: XSS ok;
at the end of the line.A cleaner approach, would be to add in a
phpcs.xml
file that defines exactly which code standards are being followed, but also allow the defining of safe functions. Here's an examplephpcs.xml
that I have for a client theme, that shows the Genesis Framework functiongenesis_attr()
does not need escaping:Adapt that to QM, and all of the relevant inline WPCS XSS comments can be removed.
The text was updated successfully, but these errors were encountered: