Skip to content

Commit 4441f6e

Browse files
committed
Revert "Remove is_in_function_call() tests from NonceVerificationUnitTest.1.inc"
This reverts commit a523676.
1 parent 59e4e53 commit 4441f6e

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

WordPress/Tests/Security/NonceVerificationUnitTest.1.inc

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -291,18 +291,18 @@ function function_containing_nested_closure() {
291291
};
292292
}
293293

294+
// Tests specifically for the ContextHelper::is_in_function_call().
295+
function disallow_custom_unslash_before_noncecheck_via_method() {
296+
$var = MyClass::stripslashes_from_strings_only( $_POST['foo'] ); // Bad.
297+
wp_verify_nonce( $var );
298+
echo $var;
299+
}
294300

295-
296-
297-
298-
299-
300-
301-
302-
303-
304-
305-
301+
function disallow_custom_unslash_before_noncecheck_via_namespaced_function() {
302+
$var = MyNamespace\stripslashes_from_strings_only( $_POST['foo'] ); // Bad.
303+
wp_verify_nonce( $var );
304+
echo $var;
305+
}
306306

307307
// Tests specifically for the ContextHelper::is_in_isset_or_empty().
308308
function allow_in_array_key_exists_before_noncecheck() {

WordPress/Tests/Security/NonceVerificationUnitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public function getErrorList( $testFile = '' ) {
5959
192 => 1,
6060
242 => 1,
6161
259 => 1,
62+
296 => 1,
63+
302 => 1,
6264
325 => 1,
6365
329 => 1,
6466
337 => 1,

0 commit comments

Comments
 (0)