From 979e5754a5ca7601f573957a69971b4e37bf869a Mon Sep 17 00:00:00 2001 From: ctrlcctrlv Date: Sat, 17 Aug 2013 19:08:54 +0000 Subject: Better error handling --- inc/display.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'inc/display.php') diff --git a/inc/display.php b/inc/display.php index 0f1bc195..9009be9a 100644 --- a/inc/display.php +++ b/inc/display.php @@ -74,6 +74,9 @@ function error($message, $priority = true, $debug_stuff = false) { if ($config['debug'] && isset($db_error)) { $debug_stuff = array_combine(array('SQLSTATE', 'Error code', 'Error message'), $db_error); } + + // Return the bad request header, necessary for AJAX posts + http_response_code(400); die(Element('page.html', array( 'config' => $config, -- cgit v1.3