Skip to content

Commit

Permalink
add common functions that return int/float to escaping functions as t…
Browse files Browse the repository at this point in the history
…hey are safe

count
rand
random_int
ceil
floor
round
  • Loading branch information
kkmuffme committed Sep 4, 2022
1 parent 17dbd17 commit f3f7d26
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions WordPress/Sniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ abstract class Sniff implements PHPCS_Sniff {
*/
protected $escapingFunctions = array(
'absint' => true,
'count' => true,
'ceil' => true,
'esc_attr__' => true,
'esc_attr_e' => true,
'esc_attr_x' => true,
Expand All @@ -79,12 +81,16 @@ abstract class Sniff implements PHPCS_Sniff {
'filter_input' => true,
'filter_var' => true,
'floatval' => true,
'floor' => true,
'highlight_string' => true,
'intval' => true,
'json_encode' => true,
'like_escape' => true,
'number_format' => true,
'rand' => true,
'random_int' => true,
'rawurlencode' => true,
'round' => true,
'sanitize_hex_color' => true,
'sanitize_hex_color_no_hash' => true,
'sanitize_html_class' => true,
Expand Down

0 comments on commit f3f7d26

Please sign in to comment.