Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e567012

Browse files
Improve mb_*trim polyfills
1 parent 1011272 commit e567012

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

‎bootstrap.php‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,15 @@ function utf8_decode($string) { return p\Php72::utf8_decode($string); }
4646
if (!function_exists('spl_object_id')) {
4747
function spl_object_id($object) { return p\Php72::spl_object_id($object); }
4848
}
49-
if (!function_exists('mb_ord')) {
50-
function mb_ord($string, $encoding = null) { return p\Php72::mb_ord($string, $encoding); }
51-
}
52-
if (!function_exists('mb_chr')) {
53-
function mb_chr($codepoint, $encoding = null) { return p\Php72::mb_chr($codepoint, $encoding); }
54-
}
55-
if (!function_exists('mb_scrub')) {
56-
function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
49+
50+
if (extension_loaded('mbstring')) {
51+
if (!function_exists('mb_ord')) {
52+
function mb_ord($string, $encoding = null) { return p\Php72::mb_ord($string, $encoding); }
53+
}
54+
if (!function_exists('mb_chr')) {
55+
function mb_chr($codepoint, $encoding = null) { return p\Php72::mb_chr($codepoint, $encoding); }
56+
}
57+
if (!function_exists('mb_scrub')) {
58+
function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
59+
}
5760
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /