File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
Expand file tree Collapse file tree 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)
2323 Token::VAR_START_TYPE === $ tokens ->look (Lexer::NEXT_TOKEN )->getType () &&
2424 Token::WHITESPACE_TYPE === $ tokens ->look (2 )->getType () &&
2525 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+ }
3437
3538 $ tokens ->next ();
3639 }
You can’t perform that action at this time.
0 commit comments