diff --git a/Helper/Helper.php b/Helper/Helper.php index 0ddddf6bc..0521aaf7d 100644 --- a/Helper/Helper.php +++ b/Helper/Helper.php @@ -47,6 +47,8 @@ public function getHelperSet() */ public static function strlen($string) { + $string = (string) $string; + if (false === $encoding = mb_detect_encoding($string, null, true)) { return \strlen($string); } @@ -65,6 +67,8 @@ public static function strlen($string) */ public static function substr($string, $from, $length = null) { + $string = (string) $string; + if (false === $encoding = mb_detect_encoding($string, null, true)) { return substr($string, $from, $length); }