Skip to content

Commit a8ad671

Browse files
committed
EscapeOutput: add sanitize_key() to escaping functions
`sanitize_key()` only allows for lowercase characters, numbers, underscore and dash characters. So a variable run through `sanitize_key()` can be considered just as safe, if not more so, than a variable run through one of the escaping functions. Ref: * https://developer.wordpress.org/reference/functions/sanitize_key/
1 parent 45ecdf0 commit a8ad671

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

WordPress/Sniff.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ abstract class Sniff implements PHPCS_Sniff {
155155
'number_format' => true,
156156
'rawurlencode' => true,
157157
'sanitize_html_class' => true,
158+
'sanitize_key' => true,
158159
'sanitize_user_field' => true,
159160
'tag_escape' => true,
160161
'urlencode_deep' => true,

0 commit comments

Comments
 (0)