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
When using sanitize_html_class() to sanitize an HTML class, PHP_CodeSniffer reports that the passed variable is not unslashed before sanitization. However, sanitize_html_class() strips the string down to A-Z, a-z, 0-9, _, and - (code reference), and therefore it should be listed as an unslashing sanitizing function, similar to sanitize_key(). Instead, it is currently listed as a general sanitizing function.
Bug Description
When using
sanitize_html_class()
to sanitize an HTML class, PHP_CodeSniffer reports that the passed variable is not unslashed before sanitization. However,sanitize_html_class()
strips the string down toA-Z
,a-z
,0-9
,_
, and-
(code reference), and therefore it should be listed as an unslashing sanitizing function, similar tosanitize_key()
. Instead, it is currently listed as a general sanitizing function.Minimal Code Snippet
The issue happens when running this command:
... over a file containing this code:
Error Code
WordPress.Security.ValidatedSanitizedInput.MissingUnslash
Environment
Tested Against
develop
Branch?develop
branch of WordPressCS.The text was updated successfully, but these errors were encountered: