This repository was archived by the owner on Sep 23, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ private function parseCharacter($bIsForIdentifier) {
265265 if (preg_match ('/[0-9a-fA-F]/Su ' , $ this ->peek ()) === 0 ) {
266266 return $ this ->consume (1 );
267267 }
268- $ sUnicode = $ this ->consumeExpression ('/^[0-9a-fA-F]{1,6}/u ' );
268+ $ sUnicode = $ this ->consumeExpression ('/^[0-9a-fA-F]{1,6}/u ' , 6 );
269269 if ($ this ->strlen ($ sUnicode ) < 6 ) {
270270 //Consume whitespace after incomplete unicode escape
271271 if (preg_match ('/ \\s/isSu ' , $ this ->peek ())) {
@@ -565,9 +565,10 @@ private function consume($mValue = 1) {
565565 }
566566 }
567567
568- private function consumeExpression ($ mExpression ) {
568+ private function consumeExpression ($ mExpression, $ iMaxLength = null ) {
569569 $ aMatches = null ;
570- if (preg_match ($ mExpression , $ this ->inputLeft (), $ aMatches , PREG_OFFSET_CAPTURE ) === 1 ) {
570+ $ sInput = $ iMaxLength !== null ? $ this ->peek ($ iMaxLength ) : $ this ->inputLeft ();
571+ if (preg_match ($ mExpression , $ sInput , $ aMatches , PREG_OFFSET_CAPTURE ) === 1 ) {
571572 return $ this ->consume ($ aMatches [0 ][0 ]);
572573 }
573574 throw new UnexpectedTokenException ($ mExpression , $ this ->peek (5 ), 'expression ' , $ this ->iLineNo );
You can’t perform that action at this time.
0 commit comments