Skip to content

Commit 1bcf335

Browse files
committed
Fixed php 8 compatibility related to INI directive mbstring.func_overload.
1 parent 9b1a614 commit 1bcf335

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Core.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ public static function ourStrlen($str)
285285
{
286286
static $exists = null;
287287
if ($exists === null) {
288-
$exists = \extension_loaded('mbstring') && \ini_get('mbstring.func_overload') !== false && (int)\ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING;
288+
$exists = \extension_loaded('mbstring') && \function_exists('mb_strlen');
289289
}
290290
if ($exists) {
291291
$length = \mb_strlen($str, '8bit');
@@ -311,7 +311,7 @@ public static function ourSubstr($str, $start, $length = null)
311311
{
312312
static $exists = null;
313313
if ($exists === null) {
314-
$exists = \extension_loaded('mbstring') && \ini_get('mbstring.func_overload') !== false && (int)\ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING;
314+
$exists = \extension_loaded('mbstring') && \function_exists('mb_substr');
315315
}
316316

317317
// This is required to make mb_substr behavior identical to substr.

0 commit comments

Comments
 (0)