Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RestrictedFunctions: fix false negative - functions in config_settings would never match #566

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions WordPress-VIP-Go/ruleset-test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,9 @@ wp_cache_get_multi(); // Error.
opcache_reset(); // Error.
opcache_invalidate( 'test_script.php' ); // Error.
opcache_compile_file( $var ); // Error.
opcache_​is_​script_​cached( 'test_script.php' ); // Error.
opcache_​get_​status(); // Error.
opcache_​get_​configuration(); // Error.
opcache_is_script_cached( 'test_script.php' ); // Error.
opcache_get_status(); // Error.
opcache_get_configuration(); // Error.
get_super_admins(); // OK.
wpcom_vip_irc(); // Error.
flush_rewrite_rules(); // Error.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public function getGroups() {
'type' => 'error',
'message' => '`%s` is not recommended for use on the WordPress VIP platform due to potential setting changes.',
'functions' => [
'opcache_​is_​script_​cached',
'opcache_​get_​status',
'opcache_​get_​configuration',
'opcache_is_script_cached',
'opcache_get_status',
'opcache_get_configuration',
],
],
'get_super_admins' => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,17 @@ wp_cache_get_multi(); // Error.
opcache_resets(); // Ok - similarly-named custom function to opcache_reset().
opcach_invalidate ( $test_script ); // Ok - similarly-named custom function to opcache_invalidate().
opcache_compil_file(); // Ok - similarly-named custom function to opcache_compile_file().
okcache_is_​script_​cached( 'test_script.php' ); // Ok - similarly-named custom function to opcache_is_script_cached().
okcache_is_script_cached( 'test_script.php' ); // Ok - similarly-named custom function to opcache_is_script_cached().
foo_opcache_get_status( $test_script ); // Ok - similarly-named custom function to opcache_get_status().
opcache_get_config( $test_script ); // Ok - similary-named custom function to opcache_get_configuration().
opcache_reset(); // Error.
opcache_invalidate( 'test_script.php' ); // Error - one parameter.
opcache_invalidate( $test_script, true ); // Error - two parameters.
opcache_compile_file( $test_script ); // Error - one parameter.
opcache_​is_​script_​cached( 'test_script.php' ); // Error - one parameter.
opcache_​get_​status(); // Error.
opcache_​get_​status( false ); // Error.
opcache_​get_​configuration(); // Error.
opcache_is_script_cached( 'test_script.php' ); // Error - one parameter.
opcache_get_status(); // Error.
opcache_get_status( false ); // Error.
opcache_get_configuration(); // Error.

get_super_admin(); // Ok - similarly-named function to get_super_admins().
get_super_admins(); // Error.
Expand Down
6 changes: 3 additions & 3 deletions WordPressVIPMinimum/ruleset-test.inc
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,9 @@ wp_cache_get_multi(); // Error.
opcache_reset(); // Error.
opcache_invalidate( 'test_script.php' ); // Error.
opcache_compile_file( $var ); // Error.
opcache_​is_​script_​cached( 'test_script.php' ); // Error.
opcache_​get_​status(); // Error.
opcache_​get_​configuration(); // Error.
opcache_is_script_cached( 'test_script.php' ); // Error.
opcache_get_status(); // Error.
opcache_get_configuration(); // Error.
get_super_admins(); // Error.
wpcom_vip_irc(); // Error.
flush_rewrite_rules(); // Error.
Expand Down