mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Don't encode Unicode when printing JSON error message
This commit is contained in:
parent
335d356c0c
commit
6e0a51520d
1 changed files with 3 additions and 1 deletions
|
|
@ -667,11 +667,13 @@ class Debug
|
|||
header('HTTP/1.1 500 Internal Server Error');
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET' || !isset($_SERVER['HTTP_X_REQUESTED_WITH']))
|
||||
{
|
||||
header('Content-Type: text/html; charset=UTF-8');
|
||||
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)));
|
||||
header('Content-Type: application/json; charset=UTF-8');
|
||||
echo json_encode(array('error' => -1, 'message' => escape($message, false)), \JSON_UNESCAPED_UNICODE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue