From 825dbf54fbab2aa150aac851bfbc5e3cc68b0dca Mon Sep 17 00:00:00 2001 From: Paul Schreiber Date: Wed, 8 Apr 2020 12:16:58 -0400 Subject: [PATCH] replace WordPress.WP.TimezoneChange with WordPress.DateTime.RestrictedFunctions --- WordPressVIPMinimum/ruleset-test.inc | 12 ++++++------ WordPressVIPMinimum/ruleset.xml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/WordPressVIPMinimum/ruleset-test.inc b/WordPressVIPMinimum/ruleset-test.inc index 5a66acb7..d0e67828 100644 --- a/WordPressVIPMinimum/ruleset-test.inc +++ b/WordPressVIPMinimum/ruleset-test.inc @@ -41,7 +41,7 @@ $args = array( _query_posts( 'posts_per_page=999' ); // Warning. $query_args['posts_per_page'] = 999; // Warning. -// WordPress.WP.TimezoneChange +// WordPress.DateTime.RestrictedFunctions date_default_timezone_set( 'FooBar' ); // Error. // WordPress.DB.PreparedSQL @@ -50,10 +50,10 @@ $b = function () { $listofthings = wp_cache_get( $listofthings ); if ( ! $listofthings ) { $foo = "column = 'test'"; - + $listofthings = $wpdb->query( 'SELECT something FROM somewhere WHERE ' . $foo ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery -- Error. wp_cache_set( 'foo', $listofthings ); - } + } }; // WordPress.DB.DirectDatabaseQuery @@ -124,7 +124,7 @@ class TestClass extends MyClass { ?> -// if (empty($this)) {echo 'This is will not work';} +// if (empty($this)) {echo 'This is will not work';} // Squiz.PHP.Eval eval('$var = 4;'); // Error + Message. @@ -430,7 +430,7 @@ $args = array( ); $query_args['orderby'] = 'rand'; // Error. -// WordPressVIPMinimum.Performance.RegexpCompare +// WordPressVIPMinimum.Performance.RegexpCompare $query_args = array( 'posts_per_page' => 1, 'post_status' => 'draft', @@ -515,7 +515,7 @@ str_replace( 'foo', array( 'bar', 'foo' ), 'foobar' ); // Error. // WordPressVIPMinimum.Security.Underscorejs echo ""; diff --git a/WordPressVIPMinimum/ruleset.xml b/WordPressVIPMinimum/ruleset.xml index 042f9289..646f60a3 100644 --- a/WordPressVIPMinimum/ruleset.xml +++ b/WordPressVIPMinimum/ruleset.xml @@ -27,7 +27,7 @@ - +