summaryrefslogtreecommitdiffstats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/core/CodeIgniter.php2
-rw-r--r--system/core/Common.php29
-rw-r--r--system/core/Exceptions.php2
-rw-r--r--system/core/Input.php3
-rw-r--r--system/core/Output.php2
-rw-r--r--system/database/DB_driver.php2
-rw-r--r--system/helpers/download_helper.php5
-rw-r--r--system/helpers/url_helper.php2
-rw-r--r--system/libraries/Driver.php2
-rw-r--r--system/libraries/Trackback.php4
-rw-r--r--system/libraries/Xmlrpcs.php3
11 files changed, 37 insertions, 19 deletions
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php
index 7f76977b5..5a872ef21 100644
--- a/system/core/CodeIgniter.php
+++ b/system/core/CodeIgniter.php
@@ -188,7 +188,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
if ($EXT->call_hook('cache_override') === FALSE
&& $OUT->_display_cache($CFG, $URI) === TRUE)
{
- exit;
+ exit(0);
}
/*
diff --git a/system/core/Common.php b/system/core/Common.php
index ee9bb2e87..3cd97dc2e 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -1,3 +1,4 @@
+
<?php
/**
* CodeIgniter
@@ -175,7 +176,8 @@ if ( ! function_exists('load_class'))
// Note: We use exit() rather then show_error() in order to avoid a
// self-referencing loop with the Exceptions class
set_status_header(503);
- exit('Unable to locate the specified class: '.$class.'.php');
+ echo 'Unable to locate the specified class: '.$class.'.php';
+ exit(2);
}
// Keep track of what we just loaded
@@ -248,14 +250,16 @@ if ( ! function_exists('get_config'))
elseif ( ! $found)
{
set_status_header(503);
- exit('The configuration file does not exist.');
+ echo 'The configuration file does not exist.';
+ exit(1);
}
// Does the $config array exist in the file?
if ( ! isset($config) OR ! is_array($config))
{
set_status_header(503);
- exit('Your config file does not appear to be formatted correctly.');
+ echo 'Your config file does not appear to be formatted correctly.';
+ exit(1);
}
// Are any values being dynamically replaced?
@@ -367,9 +371,20 @@ if ( ! function_exists('show_error'))
*/
function show_error($message, $status_code = 500, $heading = 'An Error Was Encountered')
{
+ $status_code = abs($status_code);
+ if ($status_code < 100)
+ {
+ $exit_status = $status_code + 28;
+ $status_code = 500;
+ }
+ else
+ {
+ $exit_status = 27;
+ }
+
$_error =& load_class('Exceptions', 'core');
echo $_error->show_error($heading, $message, 'error_general', $status_code);
- exit;
+ exit($exit_status);
}
}
@@ -392,7 +407,7 @@ if ( ! function_exists('show_404'))
{
$_error =& load_class('Exceptions', 'core');
$_error->show_404($page, $log_error);
- exit;
+ exit(4);
}
}
@@ -514,11 +529,11 @@ if ( ! function_exists('set_status_header'))
if (strpos(php_sapi_name(), 'cgi') === 0)
{
- header('Status: '.$code.' '.$text, TRUE);
+ if (!headers_sent()) header('Status: '.$code.' '.$text, TRUE);
}
else
{
- header(($server_protocol ? $server_protocol : 'HTTP/1.1').' '.$code.' '.$text, TRUE, $code);
+ if (!headers_sent()) header(($server_protocol ? $server_protocol : 'HTTP/1.1').' '.$code.' '.$text, TRUE, $code);
}
}
}
diff --git a/system/core/Exceptions.php b/system/core/Exceptions.php
index e6023e73b..f799d6027 100644
--- a/system/core/Exceptions.php
+++ b/system/core/Exceptions.php
@@ -117,7 +117,7 @@ class CI_Exceptions {
}
echo $this->show_error($heading, $message, 'error_404', 404);
- exit;
+ exit(4);
}
// --------------------------------------------------------------------
diff --git a/system/core/Input.php b/system/core/Input.php
index 68a8fe03f..904f4d6e9 100644
--- a/system/core/Input.php
+++ b/system/core/Input.php
@@ -745,7 +745,8 @@ class CI_Input {
if ( ! preg_match('/^[a-z0-9:_\/|-]+$/i', $str))
{
set_status_header(503);
- exit('Disallowed Key Characters.');
+ echo 'Disallowed Key Characters.';
+ exit(6);
}
// Clean UTF-8 if supported
diff --git a/system/core/Output.php b/system/core/Output.php
index 25ecd496c..d4abe871d 100644
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -696,7 +696,7 @@ class CI_Output {
if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && $last_modified <= strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']))
{
$this->set_status_header(304);
- exit;
+ exit(0);
}
else
{
diff --git a/system/database/DB_driver.php b/system/database/DB_driver.php
index ed0296d76..6ae1d524d 100644
--- a/system/database/DB_driver.php
+++ b/system/database/DB_driver.php
@@ -1658,7 +1658,7 @@ abstract class CI_DB_driver {
$error =& load_class('Exceptions', 'core');
echo $error->show_error($heading, $message, 'error_db');
- exit;
+ exit(5);
}
// --------------------------------------------------------------------
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index 4fe6a0e88..daf59f51b 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -141,7 +141,8 @@ if ( ! function_exists('force_download'))
// If we have raw data - just dump it
if ($data !== NULL)
{
- exit($data);
+ echo $data;
+ exit(0);
}
// Flush 1MB chunks of data
@@ -151,7 +152,7 @@ if ( ! function_exists('force_download'))
}
fclose($fp);
- exit;
+ exit(0);
}
}
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index d0fab3fe0..d6bf7e2c9 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -550,7 +550,7 @@ if ( ! function_exists('redirect'))
header('Location: '.$uri, TRUE, $code);
break;
}
- exit;
+ exit(0);
}
}
diff --git a/system/libraries/Driver.php b/system/libraries/Driver.php
index 382420db0..ba15f81df 100644
--- a/system/libraries/Driver.php
+++ b/system/libraries/Driver.php
@@ -290,7 +290,7 @@ class CI_Driver {
$trace = debug_backtrace();
_exception_handler(E_ERROR, "No such method '{$method}'", $trace[1]['file'], $trace[1]['line']);
- exit;
+ exit(3);
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php
index ecc7129e3..cc93b2e30 100644
--- a/system/libraries/Trackback.php
+++ b/system/libraries/Trackback.php
@@ -212,7 +212,7 @@ class CI_Trackback {
public function send_error($message = 'Incomplete Information')
{
echo '<?xml version="1.0" encoding="utf-8"?'.">\n<response>\n<error>1</error>\n<message>".$message."</message>\n</response>";
- exit;
+ exit(0);
}
// --------------------------------------------------------------------
@@ -228,7 +228,7 @@ class CI_Trackback {
public function send_success()
{
echo '<?xml version="1.0" encoding="utf-8"?'.">\n<response>\n<error>0</error>\n</response>";
- exit;
+ exit(0);
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php
index d263d789d..2d2e7f13b 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -170,7 +170,8 @@ class CI_Xmlrpcs extends CI_Xmlrpc {
header('Content-Type: text/xml');
header('Content-Length: '.strlen($payload));
- exit($payload);
+ echo $payload;
+ exit(0);
}
// --------------------------------------------------------------------