From 39ea4eea98972466025472e2a9e414c5e04e47da Mon Sep 17 00:00:00 2001 From: Marcus Bointon Date: Mon, 5 Sep 2016 23:23:49 +0200 Subject: [PATCH] Don't truncate to 64k in mb_str_replace --- src/PhpSpreadsheet/Calculation/Functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PhpSpreadsheet/Calculation/Functions.php b/src/PhpSpreadsheet/Calculation/Functions.php index 7afc5f6d..7813762a 100644 --- a/src/PhpSpreadsheet/Calculation/Functions.php +++ b/src/PhpSpreadsheet/Calculation/Functions.php @@ -703,7 +703,7 @@ if ((!function_exists('mb_str_replace')) && $r = !is_array($replace) ? $replace : (array_key_exists($key, $replace) ? $replace[$key] : ''); $pos = mb_strpos($subject, $s, 0, 'UTF-8'); while ($pos !== false) { - $subject = mb_substr($subject, 0, $pos, 'UTF-8') . $r . mb_substr($subject, $pos + mb_strlen($s, 'UTF-8'), 65535, 'UTF-8'); + $subject = mb_substr($subject, 0, $pos, 'UTF-8') . $r . mb_substr($subject, $pos + mb_strlen($s, 'UTF-8'), null, 'UTF-8'); $pos = mb_strpos($subject, $s, $pos + mb_strlen($r, 'UTF-8'), 'UTF-8'); } }