Skip to content

Commit 4639b05

Browse files
rodrigoprimojrfnl
andcommitted
Security/ValidatedSanitizedInput: improve InputNotValidated error message
The error message for `InputNotValidated` previously listed specific methods (isset() and empty()), but the list was incomplete. Rather than expanding it, this commit adopts a more generic message that won't require updates when new validation methods are added. Fixes 2641 Co-authored-by: Juliette <[email protected]>
1 parent b2e3d0f commit 4639b05

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

WordPress/Sniffs/Security/ValidatedSanitizedInputSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static function ( $var_name ) {
175175

176176
if ( false === $validated ) {
177177
$this->phpcsFile->addError(
178-
'Detected usage of a possibly undefined superglobal array index: %s. Use isset() or empty() to check the index exists before using it',
178+
'Detected usage of a possibly undefined superglobal array index: %s. Check that the array index exists before using it.',
179179
$stackPtr,
180180
'InputNotValidated',
181181
$error_data

0 commit comments

Comments
 (0)