@@ -30,7 +30,7 @@ public function __construct($sText, $sDefaultCharset = 'utf-8') {
30
30
31
31
public function setCharset ($ sCharset ) {
32
32
$ this ->sCharset = $ sCharset ;
33
- $ this ->iLength = $ this ->strlen ($ this ->sText , $ this -> sCharset );
33
+ $ this ->iLength = $ this ->strlen ($ this ->sText );
34
34
}
35
35
36
36
public function getCharset () {
@@ -168,7 +168,7 @@ private function parseCharacter($bIsForIdentifier) {
168
168
return $ this ->consume (1 );
169
169
}
170
170
$ sUnicode = $ this ->consumeExpression ('/^[0-9a-fA-F]{1,6}/u ' );
171
- if ($ this ->strlen ($ sUnicode, $ this -> sCharset ) < 6 ) {
171
+ if ($ this ->strlen ($ sUnicode ) < 6 ) {
172
172
//Consume whitespace after incomplete unicode escape
173
173
if (preg_match ('/ \\s/isSu ' , $ this ->peek ())) {
174
174
if ($ this ->comes ('\r\n ' )) {
@@ -356,15 +356,15 @@ private function parseColorValue() {
356
356
if ($ this ->comes ('# ' )) {
357
357
$ this ->consume ('# ' );
358
358
$ sValue = $ this ->parseIdentifier (false );
359
- if ($ this ->strlen ($ sValue, $ this -> sCharset ) === 3 ) {
359
+ if ($ this ->strlen ($ sValue ) === 3 ) {
360
360
$ sValue = $ sValue [0 ].$ sValue [0 ].$ sValue [1 ].$ sValue [1 ].$ sValue [2 ].$ sValue [2 ];
361
361
}
362
362
$ aColor = array ('r ' => new CSSSize (intval ($ sValue [0 ].$ sValue [1 ], 16 ), null , true ), 'g ' => new CSSSize (intval ($ sValue [2 ].$ sValue [3 ], 16 ), null , true ), 'b ' => new CSSSize (intval ($ sValue [4 ].$ sValue [5 ], 16 ), null , true ));
363
363
} else {
364
364
$ sColorMode = $ this ->parseIdentifier (false );
365
365
$ this ->consumeWhiteSpace ();
366
366
$ this ->consume ('( ' );
367
- $ iLength = $ this ->strlen ($ sColorMode, $ this -> sCharset );
367
+ $ iLength = $ this ->strlen ($ sColorMode );
368
368
for ($ i =0 ;$ i <$ iLength ;$ i ++) {
369
369
$ this ->consumeWhiteSpace ();
370
370
$ aColor [$ sColorMode [$ i ]] = $ this ->parseNumericValue (true );
@@ -406,27 +406,27 @@ private function peek($iLength = 1, $iOffset = 0) {
406
406
return '' ;
407
407
}
408
408
if (is_string ($ iLength )) {
409
- $ iLength = $ this ->strlen ($ iLength, $ this -> sCharset );
409
+ $ iLength = $ this ->strlen ($ iLength );
410
410
}
411
411
if (is_string ($ iOffset )) {
412
- $ iOffset = $ this ->strlen ($ iOffset, $ this -> sCharset );
412
+ $ iOffset = $ this ->strlen ($ iOffset );
413
413
}
414
- return $ this ->substr ($ this ->sText , $ this ->iCurrentPosition +$ iOffset , $ iLength, $ this -> sCharset );
414
+ return $ this ->substr ($ this ->sText , $ this ->iCurrentPosition +$ iOffset , $ iLength );
415
415
}
416
416
417
417
private function consume ($ mValue = 1 ) {
418
418
if (is_string ($ mValue )) {
419
- $ iLength = $ this ->strlen ($ mValue, $ this -> sCharset );
420
- if ($ this ->substr ($ this ->sText , $ this ->iCurrentPosition , $ iLength, $ this -> sCharset ) !== $ mValue ) {
419
+ $ iLength = $ this ->strlen ($ mValue );
420
+ if ($ this ->substr ($ this ->sText , $ this ->iCurrentPosition , $ iLength ) !== $ mValue ) {
421
421
throw new Exception ("Expected $ mValue, got " .$ this ->peek (5 ));
422
422
}
423
- $ this ->iCurrentPosition += $ this ->strlen ($ mValue, $ this -> sCharset );
423
+ $ this ->iCurrentPosition += $ this ->strlen ($ mValue );
424
424
return $ mValue ;
425
425
} else {
426
426
if ($ this ->iCurrentPosition +$ mValue > $ this ->iLength ) {
427
427
throw new Exception ("Tried to consume $ mValue chars, exceeded file end " );
428
428
}
429
- $ sResult = $ this ->substr ($ this ->sText , $ this ->iCurrentPosition , $ mValue, $ this -> sCharset );
429
+ $ sResult = $ this ->substr ($ this ->sText , $ this ->iCurrentPosition , $ mValue );
430
430
$ this ->iCurrentPosition += $ mValue ;
431
431
return $ sResult ;
432
432
}
@@ -470,7 +470,7 @@ private function consumeUntil($sEnd) {
470
470
}
471
471
472
472
private function inputLeft () {
473
- return $ this ->substr ($ this ->sText , $ this ->iCurrentPosition , -1 , $ this -> sCharset );
473
+ return $ this ->substr ($ this ->sText , $ this ->iCurrentPosition , -1 );
474
474
}
475
475
476
476
private function substr ($ string , $ start , $ length ){
0 commit comments