mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-24 10:06:08 +02:00
Fix utf8_encode deprecation (#1722)
This commit is contained in:
@@ -149,7 +149,7 @@ class ChromePHPHandler extends AbstractProcessingHandler
|
||||
}
|
||||
|
||||
$json = Utils::jsonEncode(self::$json, Utils::DEFAULT_JSON_FLAGS & ~JSON_UNESCAPED_UNICODE, true);
|
||||
$data = base64_encode(utf8_encode($json));
|
||||
$data = base64_encode($json);
|
||||
if (strlen($data) > 3 * 1024) {
|
||||
self::$overflowed = true;
|
||||
|
||||
@@ -163,8 +163,8 @@ class ChromePHPHandler extends AbstractProcessingHandler
|
||||
'extra' => [],
|
||||
];
|
||||
self::$json['rows'][count(self::$json['rows']) - 1] = $this->getFormatter()->format($record);
|
||||
$json = Utils::jsonEncode(self::$json, null, true);
|
||||
$data = base64_encode(utf8_encode($json));
|
||||
$json = Utils::jsonEncode(self::$json, Utils::DEFAULT_JSON_FLAGS & ~JSON_UNESCAPED_UNICODE, true);
|
||||
$data = base64_encode($json);
|
||||
}
|
||||
|
||||
if (trim($data) !== '') {
|
||||
|
||||
@@ -211,7 +211,7 @@ final class Utils
|
||||
$data = preg_replace_callback(
|
||||
'/[\x80-\xFF]+/',
|
||||
function ($m) {
|
||||
return utf8_encode($m[0]);
|
||||
return function_exists('mb_convert_encoding') ? mb_convert_encoding($m[0], 'UTF-8', 'ISO-8859-1') : utf8_encode($m[0]);
|
||||
},
|
||||
$data
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user