File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1455,6 +1455,7 @@ protected function has_nonce_check( $stackPtr ) {
14551455 || $ this ->is_in_type_test ( $ stackPtr )
14561456 || $ this ->is_comparison ( $ stackPtr )
14571457 || $ this ->is_in_array_comparison ( $ stackPtr )
1458+ || $ this ->is_in_function_call ( $ stackPtr , $ this ->unslashingFunctions ) !== false
14581459 ) {
14591460 $ allow_nonce_after = true ;
14601461 }
Original file line number Diff line number Diff line change @@ -246,3 +246,21 @@ function allow_for_array_comparison_in_condition() {
246246 foo ();
247247 }
248248}
249+
250+ # Issue #572.
251+ function allow_for_unslash_before_noncecheck_but_demand_noncecheck () {
252+ $ var = wp_unslash ( $ _POST ['foo ' ] ); // Bad.
253+ echo $ var ;
254+ }
255+
256+ function allow_for_unslash_before_noncecheck () {
257+ $ var = stripslashes_from_strings_only ( $ _POST ['foo ' ] ); // OK.
258+ wp_verify_nonce ( $ var );
259+ echo $ var ;
260+ }
261+
262+ function allow_for_unslash_in_sanitization () {
263+ $ var = sanitize_text_field ( wp_unslash ( $ _POST ['foo ' ] ) ); // OK.
264+ wp_verify_nonce ( $ var );
265+ echo $ var ;
266+ }
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public function getErrorList() {
5151 190 => 1 ,
5252 198 => 1 ,
5353 202 => 1 ,
54+ 252 => 1 ,
5455 );
5556 }
5657
You can’t perform that action at this time.
0 commit comments