summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-02-19 10:36:10 +0100
committerAndrey Andreev <narf@devilix.net>2015-02-19 10:36:10 +0100
commitc545c0147636d8592fdcb7e8ec2c6df09399d485 (patch)
treefb2b61b70cfa8463219d66f99b004df708596a26
parentff7563e3ffa522f35ec18c99273a9ce14a48e6db (diff)
Make set_status_header() a dummy under CLI
Close #3605
-rw-r--r--system/core/Common.php5
-rw-r--r--user_guide_src/source/changelog.rst3
2 files changed, 7 insertions, 1 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index 9f509745f..7035c18ff 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -492,6 +492,11 @@ if ( ! function_exists('set_status_header'))
*/
function set_status_header($code = 200, $text = '')
{
+ if (is_cli())
+ {
+ return;
+ }
+
$stati = array(
200 => 'OK',
201 => 'Created',
diff --git a/user_guide_src/source/changelog.rst b/user_guide_src/source/changelog.rst
index 3145e831a..a904c827f 100644
--- a/user_guide_src/source/changelog.rst
+++ b/user_guide_src/source/changelog.rst
@@ -507,7 +507,8 @@ Release Date: Not Released
- Changed internal function ``load_class()`` to accept a constructor parameter instead of (previously unused) class name prefix.
- Removed default parameter value of :php:func:`is_php()`.
- Added a second argument ``$double_encode`` to :php:func:`html_escape()`.
- - Changed function ``config_item()`` to return NULL instead of FALSE when no value is found.
+ - Changed function :php:func:`config_item()` to return NULL instead of FALSE when no value is found.
+ - Changed function :php:func:`set_status_header()` to return immediately when run under CLI.
- :doc:`Output Library <libraries/output>` changes include: