File tree 1 file changed +11
-8
lines changed
1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,17 @@ public function check(TokenStream $tokens)
23
23
Token::VAR_START_TYPE === $ tokens ->look (Lexer::NEXT_TOKEN )->getType () &&
24
24
Token::WHITESPACE_TYPE === $ tokens ->look (2 )->getType () &&
25
25
Token::NAME_TYPE === $ tokens ->look (3 )->getType ()) {
26
-
27
- $ violations [] = $ this ->createViolation (
28
- $ tokens ->getSourceContext ()->getPath (),
29
- $ token ->getLine (),
30
- $ token ->getColumn () + strlen ($ token ->getValue ()) + 1 ,
31
- 'Unsafe attribute value without quotation mark. '
32
- );
33
- }
26
+ $ quots = substr_count (strstr ($ token ->getValue (), '< ' ), '" ' );
27
+
28
+ if (!($ quots % 2 )) {
29
+ $ violations [] = $ this ->createViolation (
30
+ $ tokens ->getSourceContext ()->getPath (),
31
+ $ tokens ->look (Lexer::NEXT_TOKEN )->getLine (),
32
+ $ tokens ->look (Lexer::NEXT_TOKEN )->getColumn () + strlen ($ tokens ->look (Lexer::NEXT_TOKEN )->getValue ()) - 1 ,
33
+ 'Unsafe attribute value without quotation mark. '
34
+ );
35
+ }
36
+ }
34
37
35
38
$ tokens ->next ();
36
39
}
You can’t perform that action at this time.
0 commit comments