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) {
265
265
if (preg_match ('/[0-9a-fA-F]/Su ' , $ this ->peek ()) === 0 ) {
266
266
return $ this ->consume (1 );
267
267
}
268
- $ sUnicode = $ this ->consumeExpression ('/^[0-9a-fA-F]{1,6}/u ' );
268
+ $ sUnicode = $ this ->consumeExpression ('/^[0-9a-fA-F]{1,6}/u ' , 6 );
269
269
if ($ this ->strlen ($ sUnicode ) < 6 ) {
270
270
//Consume whitespace after incomplete unicode escape
271
271
if (preg_match ('/ \\s/isSu ' , $ this ->peek ())) {
@@ -565,9 +565,10 @@ private function consume($mValue = 1) {
565
565
}
566
566
}
567
567
568
- private function consumeExpression ($ mExpression ) {
568
+ private function consumeExpression ($ mExpression, $ iMaxLength = null ) {
569
569
$ 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 ) {
571
572
return $ this ->consume ($ aMatches [0 ][0 ]);
572
573
}
573
574
throw new UnexpectedTokenException ($ mExpression , $ this ->peek (5 ), 'expression ' , $ this ->iLineNo );
You can’t perform that action at this time.
0 commit comments