File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -309,10 +309,13 @@ abstract class Sniff implements PHPCS_Sniff {
309309 protected $ unslashingSanitizingFunctions = array (
310310 'absint ' => true ,
311311 'boolval ' => true ,
312+ 'count ' => true ,
313+ 'doubleval ' => true ,
312314 'floatval ' => true ,
313315 'intval ' => true ,
314316 'is_array ' => true ,
315317 'sanitize_key ' => true ,
318+ 'sizeof ' => true ,
316319 );
317320
318321 /**
Original file line number Diff line number Diff line change @@ -216,3 +216,12 @@ if ( isset( $_GET['unslash_check'] ) ) {
216216 $ clean = sanitize_text_field ( WP_Faker::wp_unslash ( $ _GET ['unslash_check ' ] ) ); // Bad x1 - unslash.
217217 $ clean = WP_Faker \sanitize_text_field ( wp_unslash ( $ _GET ['unslash_check ' ] ) ); // Bad x1 - sanitize.
218218}
219+
220+ function test_more_safe_functions () {
221+ if ( ! isset ( $ _GET ['test ' ] ) ) {
222+ return ;
223+ }
224+
225+ $ float = doubleval ( $ _GET ['test ' ] ); // OK.
226+ $ count = count ( $ _GET ['test ' ] ); // Issue #1659; OK.
227+ }
You can’t perform that action at this time.
0 commit comments