diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-09-10 16:32:28 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-09-10 16:32:28 +0200 |
commit | dcc4469844f8ce98bd8323b684e40cf64643e5ae (patch) | |
tree | 568c1ab6bb3d402a22435376a26167dce04104cd /program/include/rcmail.php | |
parent | 1985eb2e6d77fcb77c95569f43e1b0f4c91bed88 (diff) |
Don't init output in CLI mode
Fixes infinite recurssion on raise_error() call when executing scripts
out of the INSTALL_PATH. Also use 'rcube' if 'rcmail' is not needed.
Diffstat (limited to 'program/include/rcmail.php')
-rw-r--r-- | program/include/rcmail.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php index ece0606ae..e1a62767d 100644 --- a/program/include/rcmail.php +++ b/program/include/rcmail.php @@ -116,11 +116,13 @@ class rcmail extends rcube $_SESSION['task'] = $this->task; } - // init output class - if (!empty($_REQUEST['_remote'])) + // init output class (not in CLI mode) + if (!empty($_REQUEST['_remote'])) { $GLOBALS['OUTPUT'] = $this->json_init(); - else + } + else if ($_SERVER['REMOTE_ADDR']) { $GLOBALS['OUTPUT'] = $this->load_gui(!empty($_REQUEST['_framed'])); + } // load plugins $this->plugins->init($this, $this->task); |