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 @@ -594,19 +594,37 @@ protected function quotedAttributeValue($quote)
594594
595595 protected function unquotedAttributeValue ()
596596 {
597- $ stoplist = "\t\n\f > " ;
598597 $ val = '' ;
599598 $ tok = $ this ->scanner ->current ();
600- while (0 == strspn ($ tok , $ stoplist ) && false !== $ tok ) {
601- if ('& ' == $ tok ) {
602- $ val .= $ this ->decodeCharacterReference (true );
603- $ tok = $ this ->scanner ->current ();
604- } else {
605- if (strspn ($ tok , "\"'<=` " ) > 0 ) {
599+ while (false !== $ tok ) {
600+ switch ($ tok ) {
601+ case "\n" :
602+ case "\f" :
603+ case ' ' :
604+ case "\t" :
605+ case '> ' :
606+ break 2 ;
607+
608+ case '& ' :
609+ $ val .= $ this ->decodeCharacterReference (true );
610+ $ tok = $ this ->scanner ->current ();
611+
612+ break ;
613+
614+ case "' " :
615+ case '" ' :
616+ case '< ' :
617+ case '= ' :
618+ case '` ' :
606619 $ this ->parseError ('Unexpected chars in unquoted attribute value %s ' , $ tok );
607- }
608- $ val .= $ tok ;
609- $ tok = $ this ->scanner ->next ();
620+ $ val .= $ tok ;
621+ $ tok = $ this ->scanner ->next ();
622+ break ;
623+
624+ default :
625+ $ val .= $ this ->scanner ->charsUntil ("\t\n\f >& \"'<=` " );
626+
627+ $ tok = $ this ->scanner ->current ();
610628 }
611629 }
612630
You can’t perform that action at this time.
0 commit comments