diff --git a/WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php b/WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php index ac18f3c7..b026b443 100644 --- a/WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php +++ b/WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php @@ -45,7 +45,7 @@ public function register() { */ public function process_token( $stackPtr ) { - if ( strpos( $this->tokens[ $stackPtr ]['content'], '{{{' ) !== false || strpos( $this->tokens[ $stackPtr ]['content'], '}}}' ) !== false ) { + if ( strpos( $this->tokens[ $stackPtr ]['content'], '{{{' ) !== false && strpos( $this->tokens[ $stackPtr ]['content'], '}}}' ) !== false ) { // Mustache unescaped output notation. $message = 'Found Mustache unescaped output notation: "{{{}}}".'; $this->phpcsFile->addWarning( $message, $stackPtr, 'OutputNotation' ); diff --git a/WordPressVIPMinimum/Tests/Security/MustacheUnitTest.inc b/WordPressVIPMinimum/Tests/Security/MustacheUnitTest.inc index 3e53d63e..12e2cb37 100644 --- a/WordPressVIPMinimum/Tests/Security/MustacheUnitTest.inc +++ b/WordPressVIPMinimum/Tests/Security/MustacheUnitTest.inc @@ -17,4 +17,7 @@ echo '{{&data}}'; // NOK: data. return new Handlebars.SafeString(result); // NOK: SafeString. }); - \ No newline at end of file + + +// Issue 541#issuecomment-1692323177: don't flag GB syntax. +