@@ -68,51 +68,6 @@ abstract class WordPress_AbstractFunctionRestrictionsSniff extends WordPress_Sni
68
68
*/
69
69
protected $ excluded_groups = array ();
70
70
71
- /**
72
- * List of known PHP and WP functions which take a callback as an argument.
73
- *
74
- * Sorted alphabetically. Last updated on 8th March 2017.
75
- *
76
- * @since 0.11.0
77
- *
78
- * @var array <string function name> => <int callback argument position>
79
- */
80
- protected $ callback_functions = array (
81
- 'add_filter ' => array ( 2 ),
82
- 'add_action ' => array ( 2 ),
83
- 'array_diff_uassoc ' => array ( -1 ), // = last argument passed.
84
- 'array_diff_ukey ' => array ( -1 ), // = last argument passed.
85
- 'array_filter ' => array ( 2 ),
86
- 'array_intersect_uassoc ' => array ( -1 ), // = last argument passed.
87
- 'array_intersect_ukey ' => array ( -1 ), // = last argument passed.
88
- 'array_map ' => array ( 1 ),
89
- 'array_reduce ' => array ( 2 ),
90
- 'array_udiff_assoc ' => array ( -1 ), // = last argument passed.
91
- 'array_udiff_uassoc ' => array ( -1 , -2 ), // = last argument passed.
92
- 'array_udiff ' => array ( -1 ), // = last argument passed.
93
- 'array_uintersect_assoc ' => array ( -1 ), // = last argument passed.
94
- 'array_uintersect_uassoc ' => array ( -1 , -2 ), // = last argument passed.
95
- 'array_uintersect ' => array ( -1 ), // = last argument passed.
96
- 'array_walk ' => array ( 2 ),
97
- 'array_walk_recursive ' => array ( 2 ),
98
- 'call_user_func ' => array ( 1 ),
99
- 'call_user_func_array ' => array ( 1 ),
100
- 'forward_static_call ' => array ( 1 ),
101
- 'forward_static_call_array ' => array ( 1 ),
102
- 'header_register_callback ' => array ( 1 ),
103
- 'iterator_apply ' => array ( 2 ),
104
- 'mb_ereg_replace_callback ' => array ( 2 ),
105
- 'ob_start ' => array ( 1 ),
106
- 'preg_replace_callback ' => array ( 2 ),
107
- 'register_shutdown_function ' => array ( 1 ),
108
- 'register_tick_function ' => array ( 1 ),
109
- 'set_error_handler ' => array ( 1 ),
110
- 'set_exception_handler ' => array ( 1 ),
111
- 'uasort ' => array ( 2 ),
112
- 'uksort ' => array ( 2 ),
113
- 'usort ' => array ( 2 ),
114
- );
115
-
116
71
/**
117
72
* Groups of functions to restrict.
118
73
*
@@ -281,7 +236,7 @@ public function is_targetted_token( $stackPtr ) {
281
236
* normal file processing.
282
237
*/
283
238
public function check_for_matches ( $ stackPtr ) {
284
- $ token_content = strtolower ( $ this ->strip_quotes ( $ this -> tokens [ $ stackPtr ]['content ' ] ) );
239
+ $ token_content = strtolower ( $ this ->tokens [ $ stackPtr ]['content ' ] );
285
240
$ skip_to = array ();
286
241
287
242
foreach ( $ this ->groups as $ groupName => $ group ) {
@@ -314,7 +269,7 @@ public function check_for_matches( $stackPtr ) {
314
269
*
315
270
* @param int $stackPtr The position of the current token in the stack.
316
271
*
317
- * @return int|void If a callback was found return stackPtr for where to skip to, false if the function call is not a callback .
272
+ * @return int|void If a callback was found return stackPtr for where to skip to.
318
273
*/
319
274
public function check_for_callback_matches ( $ stackPtr ) {
320
275
@@ -354,7 +309,7 @@ public function check_for_callback_matches( $stackPtr ) {
354
309
return ;
355
310
}
356
311
357
- $ skip_to [] = $ this ->check_for_matches ( $ callback );
312
+ $ skip_to [] = $ this ->check_for_matches ( $ this -> strip_quotes ( $ callback ) );
358
313
}
359
314
360
315
if ( empty ( $ skip_to ) || min ( $ skip_to ) === 0 ) {
0 commit comments