Skip to content

Commit 158c191

Browse files
committed
Update ruleset test for WPCS security sniffs
WPCS 2.1 became more accurate with its security sniffs, so adjust the VIP Go ruleset to match.
1 parent a35b339 commit 158c191

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

WordPress-VIP-Go/ruleset-test.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ wpcom_vip_file_get_contents( $bar ); // Ok.
6969

7070
// WordPress.Security.NonceVerification.NoNonceVerification
7171
function bar_foo() {
72-
if ( ! isset( $_POST['test'] ) ) { // Warning.
72+
if ( ! isset( $_POST['test'] ) ) { // Error.
7373
return;
7474
}
7575
}
@@ -80,7 +80,7 @@ function foo_bar() {
8080
}
8181

8282
// WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
83-
do_something( $_POST ); // Ok.
83+
do_something( $_POST ); // Error.
8484
if ( isset( $_POST['foo2'] ) ) {
8585
bar( wp_unslash( $_POST['foo2'] ) ); // Warning.
8686
}
@@ -473,7 +473,7 @@ $args = array(
473473
);
474474
$query_args['orderby'] = 'rand'; // Error.
475475

476-
// WordPressVIPMinimum.Performance.RegexpCompare
476+
// WordPressVIPMinimum.Performance.RegexpCompare
477477
$query_args = array(
478478
'posts_per_page' => 1,
479479
'post_status' => 'draft',

WordPress-VIP-Go/ruleset-test.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
60 => 1,
3737
63 => 1,
3838
66 => 1,
39+
72 => 1,
40+
83 => 1,
3941
165 => 1,
4042
180 => 1,
4143
181 => 1,
@@ -162,7 +164,6 @@
162164
575 => 1,
163165
],
164166
'warnings' => [
165-
72 => 1,
166167
85 => 1,
167168
90 => 1,
168169
94 => 1,

0 commit comments

Comments
 (0)