Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b7c053f

Browse filesBrowse files
authored
Merge pull request magento#247 from magento-commerce/imported-isaaceindhoven-magento-coding-standard-378
[Imported] Add semicolon as statement separator in the special annotation check of the `Magento2.Security.XssTemplate` sniff
2 parents 6e8b466 + 21db432 commit b7c053f
Copy full SHA for b7c053f

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎Magento2/Sniffs/Security/XssTemplateSniff.php

Copy file name to clipboardExpand all lines: Magento2/Sniffs/Security/XssTemplateSniff.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,11 @@ public function process(File $phpcsFile, $stackPtr)
147147
private function findSpecialAnnotation($stackPtr)
148148
{
149149
if ($this->tokens[$stackPtr]['code'] === T_ECHO) {
150-
$startOfStatement = $this->file->findPrevious(T_OPEN_TAG, $stackPtr);
150+
$startOfStatement = $this->file->findPrevious([T_OPEN_TAG, T_SEMICOLON], $stackPtr);
151151
return $this->file->findPrevious(T_COMMENT, $stackPtr, $startOfStatement);
152152
}
153153
if ($this->tokens[$stackPtr]['code'] === T_OPEN_TAG_WITH_ECHO) {
154-
$endOfStatement = $this->file->findNext(T_CLOSE_TAG, $stackPtr);
154+
$endOfStatement = $this->file->findNext([T_CLOSE_TAG, T_SEMICOLON], $stackPtr);
155155
return $this->file->findNext(T_COMMENT, $stackPtr, $endOfStatement);
156156
}
157157
return false;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.