Skip to content

Commit 4d71fe6

Browse files
ismaeldcomJinksi
authored andcommitted
Fix WordPress.Security phpcs report in Check model (#8473)
1 parent 8c51624 commit 4d71fe6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

changelog/fix-8470-phpcs-report

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Significance: patch
2+
Type: fix
3+
Comment: Ignore a PHPCS rule in two lines.
4+
5+

includes/fraud-prevention/models/class-check.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ public static function validate_array( array $array ): bool {
154154
*/
155155
public static function list( string $operator, array $checks ) {
156156
if ( ! in_array( $operator, self::$list_operators, true ) ) {
157+
// $operator is a predefined constant, no need to escape.
158+
// phpcs:ignore WordPress.Security.EscapeOutput
157159
throw new Fraud_Ruleset_Exception( 'Operator for the check is invalid: ' . $operator );
158160
}
159161
if ( 0 < count(
@@ -183,6 +185,8 @@ function( $check ) {
183185
*/
184186
public static function check( string $key, string $operator, $value ) {
185187
if ( ! in_array( $operator, self::$check_operators, true ) ) {
188+
// $operator is a predefined constant, no need to escape.
189+
// phpcs:ignore WordPress.Security.EscapeOutput
186190
throw new Fraud_Ruleset_Exception( 'Operator for the check is invalid: ' . $operator );
187191
}
188192

0 commit comments

Comments
 (0)