Skip to content

Commit ae02c68

Browse files
committed
Fix WordPress-VIP-Go integration tests so they pass and remove extra tests for WordPressVIPMinimum.Security.EscapingVoidReturnFunctions.Found since it will be covered in WordPressVIPMinimum
1 parent 63aede3 commit ae02c68

File tree

2 files changed

+1
-32
lines changed

2 files changed

+1
-32
lines changed

WordPress-VIP-Go/ruleset-test.inc

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ unlink( $file ); // Error.
5050
setcookie( 'cookie[three]', 'cookiethree' ); // Error.
5151

5252
// WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___COOKIE
53-
$x = isset( $_COOKIE['bar'] ) ? sanitize_key( $_COOKIE['bar'] ) : ''; // Error.
53+
$x = sanitize_key( $_COOKIE['bar'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotValidated -- Error.
5454

5555
// WordPressVIPMinimum.Variables.RestrictedVariables.cache_constraints___SERVER__HTTP_USER_AGENT__
5656
if ( ! isset( $_SERVER['HTTP_USER_AGENT'] ) ) { // Error.
@@ -322,20 +322,4 @@ update_site_option( $bar, $foo, true ); // Ok.
322322
// WordPressVIPMinimum.Functions.RestrictedFunctions.site_option_add_site_option
323323
add_site_option( 'foo', $bar ); // Ok.
324324

325-
// WordPressVIPMinimum.Security.EscapingVoidReturnFunctions.Found
326-
esc_js( _deprecated_argument() ); // Error.
327-
esc_js( _deprecated_constructor() ); // Error.
328-
esc_js( _deprecated_file() ); // Error.
329-
esc_js( _deprecated_function() ); // Error.
330-
esc_js( _deprecated_hook() ); // Error.
331-
esc_js( _doing_it_wrong() ); // Error.
332-
esc_html( _e( 'foo', 'bar' ) ); // Error.
333-
esc_html( _ex( 'foo', 'bar' ) ); // Error.
334-
esc_attr( printf( 'foo', [] ) ); // Error.
335-
esc_attr( trigger_error( 'foo' ) ); // Error (+ warning due to trigger_error() call).
336-
esc_attr( user_error( 'foo', '' ) ); // Error.
337-
esc_attr( vprintf( 'foo', [] ) ); // Error.
338-
esc_attr( wp_die( 'foo' ) ); // Error.
339-
esc_attr( wp_dropdown_pages() ); // Error.
340-
341325
?> <!-- closing PHP tag should be omitted -->

WordPress-VIP-Go/ruleset-test.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,20 +62,6 @@
6262
268 => 1,
6363
270 => 1,
6464
271 => 1,
65-
326 => 1,
66-
327 => 1,
67-
328 => 1,
68-
329 => 1,
69-
330 => 1,
70-
331 => 1,
71-
332 => 1,
72-
333 => 1,
73-
334 => 1,
74-
335 => 1,
75-
336 => 1,
76-
337 => 1,
77-
338 => 1,
78-
339 => 1,
7965
],
8066
'warnings' => [
8167
84 => 1,
@@ -130,7 +116,6 @@
130116
277 => 1,
131117
281 => 1,
132118
285 => 1,
133-
335 => 1,
134119
],
135120
'messages' => [
136121
4 => [

0 commit comments

Comments
 (0)