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
In situations like this, always escape while creating the string and store the value in a variable that is a postfixed with _escaped, _safe or _clean (e.g., $variable becomes $variable_escaped or $variable_safe).
886 | ERROR | [ ] All output should be run through an escaping function (see the Security sections in the WordPress Developer Handbooks), found '$switchname_escaped'.
The same is with '$switchname_safe'.
Am I misunderstanding this or is it a bug?
The text was updated successfully, but these errors were encountered:
No, it's not a bug. We don't do selective escaping based on the name of the variable. PHPCS cannot know if your variable is safe or not (unless it's escaped at the point of output), so it will output the error.
Developer Handbook says:
My code:
phpcs says:
The same is with '$switchname_safe'.
Am I misunderstanding this or is it a bug?
The text was updated successfully, but these errors were encountered: