Skip to content

Commit fa79b11

Browse files
Fix declaring extra constants when intl is loaded
1 parent ae7ead8 commit fa79b11

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

bootstrap.php

+14-10
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,6 @@
1111

1212
use Symfony\Polyfill\Mbstring as p;
1313

14-
if (!defined('MB_CASE_UPPER')) {
15-
define('MB_CASE_UPPER', 0);
16-
}
17-
if (!defined('MB_CASE_LOWER')) {
18-
define('MB_CASE_LOWER', 1);
19-
}
20-
if (!defined('MB_CASE_TITLE')) {
21-
define('MB_CASE_TITLE', 2);
22-
}
23-
2414
if (!function_exists('mb_convert_encoding')) {
2515
function mb_convert_encoding($s, $to, $from = null) { return p\Mbstring::mb_convert_encoding($s, $to, $from); }
2616
}
@@ -135,3 +125,17 @@ function mb_scrub($s, $enc = null) { $enc = null === $enc ? mb_internal_encoding
135125
if (!function_exists('mb_str_split')) {
136126
function mb_str_split($string, $split_length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $split_length, $encoding); }
137127
}
128+
129+
if (extension_loaded('mbstring')) {
130+
return;
131+
}
132+
133+
if (!defined('MB_CASE_UPPER')) {
134+
define('MB_CASE_UPPER', 0);
135+
}
136+
if (!defined('MB_CASE_LOWER')) {
137+
define('MB_CASE_LOWER', 1);
138+
}
139+
if (!defined('MB_CASE_TITLE')) {
140+
define('MB_CASE_TITLE', 2);
141+
}

0 commit comments

Comments
 (0)