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
if ( isset( $_POST['type_test4'] ) && namespace\is_int( $_POST['type_test4'] ) ) {} // Bad. Note: This should NOT be flagged in the future once the sniff is able to resolve relative namespaces.
525
+
}
526
+
527
+
/*
528
+
* Safeguard correct handling of all types of namespaced calls to array comparison functions.
if ( isset( $_POST['array_cmp4'] ) && namespace\in_array( $_POST['array_cmp4'], $my_array, true ) ) {} // Bad. Note: This should NOT be flagged in the future once the sniff is able to resolve relative namespaces.
535
+
}
536
+
537
+
/*
538
+
* Safeguard correct handling of all types of namespaced calls to unslashing functions.
539
+
*/
540
+
functiontest_namespaced_unslashing_functions() {
541
+
if ( isset( $_POST['unslash1'] ) ) {
542
+
$text = sanitize_text_field( \wp_unslash( $_POST['unslash1'] ) ); // OK.
$text = sanitize_text_field( namespace\wp_unslash( $_POST['unslash4'] ) ); // Bad. Note: This should NOT be flagged in the future once the sniff is able to resolve relative namespaces.
552
+
}
553
+
}
554
+
555
+
/*
556
+
* Safeguard correct handling of all types of namespaced calls to array walking functions.
$text = namespace\array_map( 'sanitize_text_field', wp_unslash( $_POST['array_walk4'] ) ); // Bad. Note: This should NOT be flagged in the future once the sniff is able to resolve relative namespaces.
570
+
}
571
+
}
572
+
573
+
/*
574
+
* Safeguard correct handling of fully qualified and relative namespaced calls to sanitizing functions.
575
+
* Qualified calls are already covered above.
576
+
*/
577
+
functiontest_namespaced_sanitizing_functions() {
578
+
if ( isset( $_POST['sanitize1'] ) ) {
579
+
$text = \sanitize_text_field( wp_unslash( $_POST['sanitize1'] ) ); // OK.
$text = namespace\sanitize_text_field( wp_unslash( $_POST['sanitize3'] ) ); // Bad. Note: This should NOT be flagged in the future once the sniff is able to resolve relative namespaces.
586
+
}
587
+
}
588
+
589
+
/*
590
+
* Safeguard correct handling of all types of namespaced calls to unslashing + sanitizing functions.
$id = namespace\absint( $_POST['unslash_sanitize4'] ); // Bad. Note: This should NOT be flagged in the future once the sniff is able to resolve relative namespaces.
0 commit comments