File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -47,8 +47,6 @@ class Tokenizer
4747 const CONFORMANT_HTML = 'html ' ;
4848 protected $ mode = self ::CONFORMANT_HTML ;
4949
50- const WHITE = "\t\n\f " ;
51-
5250 /**
5351 * Create a new tokenizer.
5452 *
@@ -159,7 +157,7 @@ protected function consumeData()
159157 break ;
160158
161159 default :
162- if (! strspn ( $ tok, ' <& ' ) ) {
160+ if (' < ' !== $ tok && ' & ' !== $ tok ) {
163161 // NULL character
164162 if ("\00" === $ tok ) {
165163 $ this ->parseError ('Received null character. ' );
@@ -193,7 +191,7 @@ protected function characterData()
193191 case Elements::TEXT_RCDATA :
194192 return $ this ->rcdata ($ tok );
195193 default :
196- if (strspn ( $ tok, ' <& ' ) ) {
194+ if (' < ' === $ tok || ' & ' === $ tok ) {
197195 return false ;
198196 }
199197
@@ -1092,7 +1090,7 @@ protected function decodeCharacterReference($inAttribute = false)
10921090
10931091 // These indicate not an entity. We return just
10941092 // the &.
1095- if (1 === strspn ( $ tok, static :: WHITE . ' &< ' ) ) {
1093+ if ("\t" === $ tok || "\n" === $ tok || "\f" === $ tok || ' ' === $ tok || ' & ' === $ tok || ' < ' === $ tok ) {
10961094 // $this->scanner->next();
10971095 return '& ' ;
10981096 }
You can’t perform that action at this time.
0 commit comments