Fix "malformed UTF-8" error with log viewing.
This commit is contained in:
parent
7e97caa425
commit
762e0a7c84
|
@ -28,8 +28,11 @@ trait LogViewerTrait
|
|||
$log_contents_parts = explode("\n", file_get_contents($log_path));
|
||||
$log_contents_parts = str_replace(['>', '<'], ['>', '<'], $log_contents_parts);
|
||||
|
||||
$log_contents = implode("\n", $log_contents_parts);
|
||||
$log_contents = mb_convert_encoding($log_contents, 'UTF-8', 'UTF-8');
|
||||
|
||||
return $response->withJson([
|
||||
'contents' => implode("\n", $log_contents_parts),
|
||||
'contents' => $log_contents,
|
||||
'eof' => true,
|
||||
]);
|
||||
}
|
||||
|
@ -66,7 +69,9 @@ trait LogViewerTrait
|
|||
}
|
||||
|
||||
$log_contents_parts = str_replace(['>', '<'], ['>', '<'], $log_contents_parts);
|
||||
|
||||
$log_contents = implode("\n", $log_contents_parts);
|
||||
$log_contents = mb_convert_encoding($log_contents, 'UTF-8', 'UTF-8');
|
||||
|
||||
fclose($fp);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue