mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
디버그에서 최후의 수단으로 text를 출력하는 경우에도 상황에 맞는 인코딩 및 escape 처리
This commit is contained in:
parent
ff79092019
commit
bf6dca0f7d
1 changed files with 9 additions and 1 deletions
|
|
@ -664,7 +664,15 @@ class Debug
|
|||
}
|
||||
catch (\Error $e)
|
||||
{
|
||||
print $message;
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET')
|
||||
{
|
||||
echo sprintf('<html><head><meta charset="UTF-8" /><title>%s</title></head><body>%s</body></html>', escape($title, false), escape($message, false));
|
||||
}
|
||||
else
|
||||
{
|
||||
echo json_encode(array('error' => -1, 'message' => escape($message, false)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue