diff options
| author | czaks <marcin@6irc.net> | 2016-05-05 07:51:55 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2016-05-05 07:51:55 +0200 |
| commit | 97681613274c35061bcbd8d14e03600d5fb18345 (patch) | |
| tree | 9745aa1e31b2e72d76f760d55dc9bd811c36e906 /inc/display.php | |
| parent | 7c3126866cd291d515ab5cc83d4635c3c95c6d85 (diff) | |
simplify the code a bit
Diffstat (limited to 'inc/display.php')
| -rw-r--r-- | inc/display.php | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/inc/display.php b/inc/display.php index 90cf3434..58cb4805 100644 --- a/inc/display.php +++ b/inc/display.php @@ -94,21 +94,16 @@ function error($message, $priority = true, $debug_stuff = false) { $debug_stuff['backtrace'] = debug_backtrace(); } - // Return the bad request header, necessary for AJAX posts - // czaks: is it really so? the ajax errors only work when this is commented out - // better yet use it when ajax is disabled - if (!isset ($_POST['json_response'])) { - header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request'); - } - - // Is there a reason to disable this? if (isset($_POST['json_response'])) { header('Content-Type: text/json; charset=utf-8'); die(json_encode(array( 'error' => $message ))); } - + else { + header($_SERVER['SERVER_PROTOCOL'] . ' 400 Bad Request'); + } + $pw = $config['db']['password']; $debug_callback = function(&$item) use (&$debug_callback, $pw) { if (is_array($item)) { |
