mirror of
https://github.com/retailcrm/Fetch.git
synced 2025-02-06 02:39:21 +03:00
fix: Вместо подавления ошибки в mb_string-функциях ловим выпадающий эксепшен
This commit is contained in:
parent
a306ea53af
commit
229e2e8a72
@ -599,11 +599,18 @@ class Message
|
|||||||
}
|
}
|
||||||
|
|
||||||
$converted = null;
|
$converted = null;
|
||||||
if (!$converted && function_exists('mb_convert_encoding') && @mb_check_encoding($text, $from)) {
|
if (!$converted && function_exists('mb_convert_encoding')) {
|
||||||
$converted = @mb_convert_encoding($text, $to, $from);
|
try {
|
||||||
|
if (mb_check_encoding($text, $from)) {
|
||||||
|
$converted = mb_convert_encoding($text, $to, $from);
|
||||||
|
}
|
||||||
|
} catch (\ValueError $e) {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$converted && function_exists('iconv')) {
|
if (!$converted && function_exists('iconv')) {
|
||||||
|
// Для `iconv` @ пока работает
|
||||||
$converted = @iconv($from, $to . self::$charsetFlag, $text);
|
$converted = @iconv($from, $to . self::$charsetFlag, $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user