From f3f7d26a4c7544b79ccfaf4e187b3fd169a856c6 Mon Sep 17 00:00:00 2001 From: kkmuffme <11071985+kkmuffme@users.noreply.github.com> Date: Sun, 4 Sep 2022 12:06:47 +0200 Subject: [PATCH] add common functions that return int/float to escaping functions as they are safe count rand random_int ceil floor round --- WordPress/Sniff.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/WordPress/Sniff.php b/WordPress/Sniff.php index c54d6c23c4..d592b5287d 100644 --- a/WordPress/Sniff.php +++ b/WordPress/Sniff.php @@ -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, @@ -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,