@@ -367,9 +367,9 @@ private function parsePrimitiveValue() {
367
367
$ this ->consumeWhiteSpace ();
368
368
if (is_numeric ($ this ->peek ()) || ($ this ->comes ('-. ' ) && is_numeric ($ this ->peek (1 , 2 ))) || (($ this ->comes ('- ' ) || $ this ->comes ('. ' )) && is_numeric ($ this ->peek (1 , 1 )))) {
369
369
$ oValue = $ this ->parseNumericValue ();
370
- } else if ($ this ->comes ('# ' ) || $ this ->comes ('rgb ' ) || $ this ->comes ('hsl ' )) {
370
+ } else if ($ this ->comes ('# ' ) || $ this ->comes ('rgb ' , true ) || $ this ->comes ('hsl ' , true )) {
371
371
$ oValue = $ this ->parseColorValue ();
372
- } else if ($ this ->comes ('url ' )) {
372
+ } else if ($ this ->comes ('url ' , true )) {
373
373
$ oValue = $ this ->parseURLValue ();
374
374
} else if ($ this ->comes ("' " ) || $ this ->comes ('" ' )) {
375
375
$ oValue = $ this ->parseStringValue ();
@@ -395,7 +395,7 @@ private function parseNumericValue($bForColor = false) {
395
395
$ fSize = floatval ($ sSize );
396
396
$ sUnit = null ;
397
397
foreach (explode ('/ ' , Size::ABSOLUTE_SIZE_UNITS .'/ ' .Size::RELATIVE_SIZE_UNITS .'/ ' .Size::NON_SIZE_UNITS ) as $ sDefinedUnit ) {
398
- if ($ this ->comes ($ sDefinedUnit , 0 , true )) {
398
+ if ($ this ->comes ($ sDefinedUnit , true )) {
399
399
$ sUnit = $ sDefinedUnit ;
400
400
$ this ->consume ($ sDefinedUnit );
401
401
break ;
@@ -432,7 +432,7 @@ private function parseColorValue() {
432
432
}
433
433
434
434
private function parseURLValue () {
435
- $ bUseUrl = $ this ->comes ('url ' );
435
+ $ bUseUrl = $ this ->comes ('url ' , true );
436
436
if ($ bUseUrl ) {
437
437
$ this ->consume ('url ' );
438
438
$ this ->consumeWhiteSpace ();
@@ -454,11 +454,11 @@ private static function identifierIs($sIdentifier, $sMatch, $bCaseInsensitive =
454
454
return preg_match ("/^(- \\w+-)? $ sMatch$/ " .($ bCaseInsensitive ? 'i ' : '' ), $ sIdentifier ) === 1 ;
455
455
}
456
456
457
- private function comes ($ sString , $ iOffset = 0 , $ bCaseInsensitive = true ) {
458
- $ sPeek = $ this ->peek ($ sString, $ iOffset );
457
+ private function comes ($ sString , $ alpha = false ) {
458
+ $ sPeek = $ this ->peek ($ alpha ? strlen ( $ sString) : $ sString );
459
459
return ($ sPeek == '' )
460
460
? false
461
- : $ this ->streql ($ sPeek , $ sString , $ bCaseInsensitive );
461
+ : $ this ->streql ($ sPeek , $ sString , $ alpha );
462
462
}
463
463
464
464
private function peek ($ iLength = 1 , $ iOffset = 0 ) {
0 commit comments