diff options
Diffstat (limited to 'system/core/Common.php')
-rw-r--r-- | system/core/Common.php | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/system/core/Common.php b/system/core/Common.php index cef9f47e0..c4f6dd30b 100644 --- a/system/core/Common.php +++ b/system/core/Common.php @@ -318,12 +318,9 @@ if ( ! function_exists('get_mimes')) if (empty($_mimes)) { - $_mimes = array(); - - if (file_exists(APPPATH.'config/mimes.php')) - { - $_mimes = array_merge($_mimes, include(APPPATH.'config/mimes.php')); - } + $_mimes = file_exists(APPPATH.'config/mimes.php') + ? include(APPPATH.'config/mimes.php') + : array(); if (file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) { @@ -564,12 +561,12 @@ if ( ! function_exists('set_status_header')) if (strpos(PHP_SAPI, 'cgi') === 0) { header('Status: '.$code.' '.$text, TRUE); + return; } - else - { - $server_protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'; - header($server_protocol.' '.$code.' '.$text, TRUE, $code); - } + + $server_protocol = (isset($_SERVER['SERVER_PROTOCOL']) && in_array($_SERVER['SERVER_PROTOCOL'], array('HTTP/1.0', 'HTTP/1.1', 'HTTP/2'), TRUE)) + ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1'; + header($server_protocol.' '.$code.' '.$text, TRUE, $code); } } |