mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
Don't print error in JSON if not an AJAX request
https://xetown.com/questions/1131537
This commit is contained in:
parent
ea5d955072
commit
335d356c0c
1 changed files with 1 additions and 1 deletions
|
|
@ -665,7 +665,7 @@ class Debug
|
|||
catch (\Error $e)
|
||||
{
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET')
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'GET' || !isset($_SERVER['HTTP_X_REQUESTED_WITH']))
|
||||
{
|
||||
echo sprintf('<html><head><meta charset="UTF-8" /><title>%s</title></head><body>%s</body></html>', escape($title, false), escape($message, false));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue