Skip to content

Commit ad76879

Browse files
authored
Merge pull request #566 from Automattic/fix/restricted-functions-opcache-config-settings-false-negative
RestrictedFunctions: fix false negative - functions in `config_settings` would never match
2 parents 84605b5 + b61a257 commit ad76879

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

WordPress-VIP-Go/ruleset-test.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,9 @@ wp_cache_get_multi(); // Error.
350350
opcache_reset(); // Error.
351351
opcache_invalidate( 'test_script.php' ); // Error.
352352
opcache_compile_file( $var ); // Error.
353-
opcache_​is_​script_​cached( 'test_script.php' ); // Error.
354-
opcache_​get_​status(); // Error.
355-
opcache_​get_​configuration(); // Error.
353+
opcache_is_script_cached( 'test_script.php' ); // Error.
354+
opcache_get_status(); // Error.
355+
opcache_get_configuration(); // Error.
356356
get_super_admins(); // OK.
357357
wpcom_vip_irc(); // Error.
358358
flush_rewrite_rules(); // Error.

WordPressVIPMinimum/Sniffs/Functions/RestrictedFunctionsSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public function getGroups() {
4545
'type' => 'error',
4646
'message' => '`%s` is not recommended for use on the WordPress VIP platform due to potential setting changes.',
4747
'functions' => [
48-
'opcache_​is_​script_​cached',
49-
'opcache_​get_​status',
50-
'opcache_​get_​configuration',
48+
'opcache_is_script_cached',
49+
'opcache_get_status',
50+
'opcache_get_configuration',
5151
],
5252
],
5353
'get_super_admins' => [

WordPressVIPMinimum/Tests/Functions/RestrictedFunctionsUnitTest.inc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ wp_cache_get_multi(); // Error.
2121
opcache_resets(); // Ok - similarly-named custom function to opcache_reset().
2222
opcach_invalidate ( $test_script ); // Ok - similarly-named custom function to opcache_invalidate().
2323
opcache_compil_file(); // Ok - similarly-named custom function to opcache_compile_file().
24-
okcache_is_​script_​cached( 'test_script.php' ); // Ok - similarly-named custom function to opcache_is_script_cached().
24+
okcache_is_script_cached( 'test_script.php' ); // Ok - similarly-named custom function to opcache_is_script_cached().
2525
foo_opcache_get_status( $test_script ); // Ok - similarly-named custom function to opcache_get_status().
2626
opcache_get_config( $test_script ); // Ok - similary-named custom function to opcache_get_configuration().
2727
opcache_reset(); // Error.
2828
opcache_invalidate( 'test_script.php' ); // Error - one parameter.
2929
opcache_invalidate( $test_script, true ); // Error - two parameters.
3030
opcache_compile_file( $test_script ); // Error - one parameter.
31-
opcache_​is_​script_​cached( 'test_script.php' ); // Error - one parameter.
32-
opcache_​get_​status(); // Error.
33-
opcache_​get_​status( false ); // Error.
34-
opcache_​get_​configuration(); // Error.
31+
opcache_is_script_cached( 'test_script.php' ); // Error - one parameter.
32+
opcache_get_status(); // Error.
33+
opcache_get_status( false ); // Error.
34+
opcache_get_configuration(); // Error.
3535

3636
get_super_admin(); // Ok - similarly-named function to get_super_admins().
3737
get_super_admins(); // Error.

WordPressVIPMinimum/ruleset-test.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ wp_cache_get_multi(); // Error.
312312
opcache_reset(); // Error.
313313
opcache_invalidate( 'test_script.php' ); // Error.
314314
opcache_compile_file( $var ); // Error.
315-
opcache_​is_​script_​cached( 'test_script.php' ); // Error.
316-
opcache_​get_​status(); // Error.
317-
opcache_​get_​configuration(); // Error.
315+
opcache_is_script_cached( 'test_script.php' ); // Error.
316+
opcache_get_status(); // Error.
317+
opcache_get_configuration(); // Error.
318318
get_super_admins(); // Error.
319319
wpcom_vip_irc(); // Error.
320320
flush_rewrite_rules(); // Error.

0 commit comments

Comments
 (0)