diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-06-15 15:41:09 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-06-15 15:41:09 +0200 |
commit | 51d6d8406d6493d7e3f8783c5d17a4a1970e9fba (patch) | |
tree | bfe58c26b6ddef2d786db36fe05a8ab5aed4b621 /system | |
parent | c275b23b06195e4ea6424d96a0c76b825c71443a (diff) |
Add support for HTTP code 303 in set_status_header(), as suggested in pull #341
Diffstat (limited to 'system')
-rw-r--r-- | system/core/Common.php | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/system/core/Common.php b/system/core/Common.php index 1708653e7..c309d4192 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -431,6 +431,7 @@ if ( ! function_exists('set_status_header')) 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', + 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', @@ -462,18 +463,23 @@ if ( ! function_exists('set_status_header')) 505 => 'HTTP Version Not Supported' ); - if ($code == '' OR ! is_numeric($code)) + if (empty($code) OR ! is_numeric($code)) { show_error('Status codes must be numeric', 500); } - elseif (isset($stati[$code]) && $text === '') - { - $text = $stati[$code]; - } - if ($text === '') + is_int($code) OR $code = (int) $code; + + if (empty($text)) { - show_error('No status text available. Please check your status code number or supply your own message text.', 500); + if (isset($stati[$code])) + { + $text = $stati[$code]; + } + else + { + show_error('No status text available. Please check your status code number or supply your own message text.', 500); + } } $server_protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : FALSE; |