Skip to content

Commit

Permalink
Merge pull request #1487 from WordPress-Coding-Standards/feature/nonc…
Browse files Browse the repository at this point in the history
…e-verification-errorcodes

NonceVerification: use separate errorcodes for warning vs error
  • Loading branch information
GaryJones authored Dec 18, 2018
2 parents 6a4c6c0 + 7b920b4 commit 262d002
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion WordPress/Sniffs/Security/NonceVerificationSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,17 @@ public function process_token( $stackPtr ) {
return;
}

$error_code = 'Missing';
if ( false === $this->superglobals[ $instance['content'] ] ) {
$error_code = 'Recommended';
}

// If we're still here, no nonce-verification function was found.
$this->addMessage(
'Processing form data without nonce verification.',
$stackPtr,
$this->superglobals[ $instance['content'] ],
'NoNonceVerification'
$error_code
);
}

Expand Down

0 comments on commit 262d002

Please sign in to comment.