Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion WordPressVIPMinimum/Sniffs/Security/MustacheSniff.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
5 changes: 4 additions & 1 deletion WordPressVIPMinimum/Tests/Security/MustacheUnitTest.inc
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ echo '<a href="{{href}}">{{&data}}</div></a>'; // NOK: data.

return new Handlebars.SafeString(result); // NOK: SafeString.
});
</script>
</script>

// Issue 541#issuecomment-1692323177: don't flag GB syntax.
<div class="wp-block-group"><!-- wp:heading {"textAlign":"center","style":{"spacing":{"margin":{"top":"0","right":"0","bottom":"var:preset|spacing|medium","left":"0"}}}} --><!-- OK. -->