File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed
Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1457,6 +1457,17 @@ protected function has_nonce_check( $stackPtr ) {
14571457
14581458 // If this is one of the nonce verification functions, we can bail out.
14591459 if ( isset ( $ this ->nonceVerificationFunctions [ $ tokens [ $ i ]['content ' ] ] ) ) {
1460+ /*
1461+ * Now, make sure it is a call to a global function.
1462+ */
1463+ if ( $ this ->is_class_object_call ( $ i ) === true ) {
1464+ continue ;
1465+ }
1466+
1467+ if ( $ this ->is_token_namespaced ( $ i ) === true ) {
1468+ continue ;
1469+ }
1470+
14601471 $ last ['nonce_check ' ] = $ i ;
14611472 return true ;
14621473 }
Original file line number Diff line number Diff line change @@ -178,3 +178,14 @@ function test_incorrect_use_in_type_test_functions() {
178178 return ;
179179 }
180180}
181+
182+ function fix_false_negatives_userland_method_same_name () {
183+ WP_Faker::check_ajax_referer ( 'something ' );
184+ $ faker ->check_admin_referer ( 'something ' );
185+ do_something ( $ _POST ['abc ' ] ); // Bad.
186+ }
187+
188+ function fix_false_negatives_namespaced_function_same_name () {
189+ WP_Faker \SecurityBypass \wp_verify_nonce ( 'something ' );
190+ do_something ( $ _POST ['abc ' ] ); // Bad.
191+ }
Original file line number Diff line number Diff line change @@ -47,6 +47,8 @@ public function getErrorList() {
4747 160 => 1 ,
4848 161 => 1 ,
4949 177 => 1 ,
50+ 185 => 1 ,
51+ 190 => 1 ,
5052 );
5153 }
5254
You can’t perform that action at this time.
0 commit comments