File tree Expand file tree Collapse file tree 1 file changed +28
-10
lines changed
Expand file tree Collapse file tree 1 file changed +28
-10
lines changed Original file line number Diff line number Diff line change @@ -592,19 +592,37 @@ protected function quotedAttributeValue($quote)
592592
593593 protected function unquotedAttributeValue ()
594594 {
595- $ stoplist = "\t\n\f > " ;
596595 $ val = '' ;
597596 $ tok = $ this ->scanner ->current ();
598- while (0 == strspn ($ tok , $ stoplist ) && false !== $ tok ) {
599- if ('& ' == $ tok ) {
600- $ val .= $ this ->decodeCharacterReference (true );
601- $ tok = $ this ->scanner ->current ();
602- } else {
603- if (strspn ($ tok , "\"'<=` " ) > 0 ) {
597+ while (false !== $ tok ) {
598+ switch ($ tok ) {
599+ case "\n" :
600+ case "\f" :
601+ case ' ' :
602+ case "\t" :
603+ case '> ' :
604+ break 2 ;
605+
606+ case '& ' :
607+ $ val .= $ this ->decodeCharacterReference (true );
608+ $ tok = $ this ->scanner ->current ();
609+
610+ break ;
611+
612+ case "' " :
613+ case '" ' :
614+ case '< ' :
615+ case '= ' :
616+ case '` ' :
604617 $ this ->parseError ('Unexpected chars in unquoted attribute value %s ' , $ tok );
605- }
606- $ val .= $ tok ;
607- $ tok = $ this ->scanner ->next ();
618+ $ val .= $ tok ;
619+ $ tok = $ this ->scanner ->next ();
620+ break ;
621+
622+ default :
623+ $ val .= $ this ->scanner ->charsUntil ("\t\n\f >& \"'<=` " );
624+
625+ $ tok = $ this ->scanner ->current ();
608626 }
609627 }
610628
You can’t perform that action at this time.
0 commit comments