Cast result of mb_substr to support the returned `false` when having mbstring.func_overload set 2 in php.ini