diff options
author | Derek Jones <derek.jones@ellislab.com> | 2009-07-11 19:05:58 +0200 |
---|---|---|
committer | Derek Jones <derek.jones@ellislab.com> | 2009-07-11 19:05:58 +0200 |
commit | 817163a1bcff02285f763bcf72ff02e86f218cf8 (patch) | |
tree | ca429f1c3b2acc8d72e97e6269ca3cdb5598f95b /system/libraries/Exceptions.php | |
parent | 55acc8b4d980c43e4bde04f0e0b99a594dea28ff (diff) |
Modified show_error() to allow sending of HTTP server response codes.
Added set_status_header() to the Common functions to allow use when the Output class is unavailable.
Fixed a bug where the 400 status header sent with the 'disallowed URI characters' was not compatible with CGI environments.
Diffstat (limited to 'system/libraries/Exceptions.php')
-rw-r--r-- | system/libraries/Exceptions.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/system/libraries/Exceptions.php b/system/libraries/Exceptions.php index 902b574fc..1f99d01c3 100644 --- a/system/libraries/Exceptions.php +++ b/system/libraries/Exceptions.php @@ -113,8 +113,10 @@ class CI_Exceptions { * @param string the template name * @return string */ - function show_error($heading, $message, $template = 'error_general') + function show_error($heading, $message, $template = 'error_general', $status_code = 500) { + set_status_header($status_code); + $message = '<p>'.implode('</p><p>', ( ! is_array($message)) ? array($message) : $message).'</p>'; if (ob_get_level() > $this->ob_level + 1) |