Skip to content

Commit 8457832

Browse files
committed
Merge remote-tracking branch 'vladkens/feature'
* vladkens/feature: Uses multibyte string only if loaded mbstring extension.
2 parents 4af4aff + 67e025b commit 8457832

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/Sabberworm/CSS/Settings.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
*/
1212
class Settings {
1313
/**
14-
* Multi-byte string support. If true (default), will use (slower) mb_strlen, mb_convert_case, mb_substr and mb_strpos functions. Otherwise, the normal (ASCII-Only) functions will be used.
14+
* Multi-byte string support. If true (mbstring extension must be enabled), will use (slower) mb_strlen, mb_convert_case, mb_substr and mb_strpos functions. Otherwise, the normal (ASCII-Only) functions will be used.
1515
*/
16-
public $bMultibyteSupport = true;
16+
public $bMultibyteSupport;
1717

1818
/**
1919
* The default charset for the CSS if no `@charset` rule is found. Defaults to utf-8.
@@ -25,7 +25,9 @@ class Settings {
2525
*/
2626
public $bLenientParsing = true;
2727

28-
private function __construct() {}
28+
private function __construct() {
29+
$this->bMultibyteSupport = extension_loaded('mbstring');
30+
}
2931

3032
public static function create() {
3133
return new Settings();

0 commit comments

Comments
 (0)