Reverting changes to functions that have no business being used in CLI apps to begin with
Signed-off-by: Daniel Hunsaker <danhunsaker@gmail.com>
diff --git a/system/core/Common.php b/system/core/Common.php
index e11668d..9baf5e3 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -531,16 +531,13 @@
$server_protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;
- if ( ! headers_sent())
+ if (strpos(php_sapi_name(), 'cgi') === 0)
{
- if (strpos(php_sapi_name(), 'cgi') === 0)
- {
- header('Status: '.$code.' '.$text, TRUE);
- }
- else
- {
- header(($server_protocol ? $server_protocol : 'HTTP/1.1').' '.$code.' '.$text, TRUE, $code);
- }
+ header('Status: '.$code.' '.$text, TRUE);
+ }
+ else
+ {
+ header(($server_protocol ? $server_protocol : 'HTTP/1.1').' '.$code.' '.$text, TRUE, $code);
}
}
}
diff --git a/system/helpers/download_helper.php b/system/helpers/download_helper.php
index bd32965..4fe6a0e 100644
--- a/system/helpers/download_helper.php
+++ b/system/helpers/download_helper.php
@@ -141,8 +141,7 @@
// If we have raw data - just dump it
if ($data !== NULL)
{
- echo $data;
- exit;
+ exit($data);
}
// Flush 1MB chunks of data
diff --git a/system/libraries/Trackback.php b/system/libraries/Trackback.php
index ecc7129..5a45be8 100644
--- a/system/libraries/Trackback.php
+++ b/system/libraries/Trackback.php
@@ -211,8 +211,7 @@
*/
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('<?xml version="1.0" encoding="utf-8"?'.">\n<response>\n<error>1</error>\n<message>".$message."</message>\n</response>");
}
// --------------------------------------------------------------------
@@ -227,8 +226,7 @@
*/
public function send_success()
{
- echo '<?xml version="1.0" encoding="utf-8"?'.">\n<response>\n<error>0</error>\n</response>";
- exit;
+ exit('<?xml version="1.0" encoding="utf-8"?'.">\n<response>\n<error>0</error>\n</response>");
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Xmlrpcs.php b/system/libraries/Xmlrpcs.php
index a6048cb..d263d78 100644
--- a/system/libraries/Xmlrpcs.php
+++ b/system/libraries/Xmlrpcs.php
@@ -170,8 +170,7 @@
header('Content-Type: text/xml');
header('Content-Length: '.strlen($payload));
- echo $payload;
- exit;
+ exit($payload);
}
// --------------------------------------------------------------------