From b542f8800e0d093afedf51c4789d901b454e4144 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 26 Apr 2013 11:42:48 +0200 Subject: Fix exit code on bootsrap errors in CLI mode (#1489044) --- CHANGELOG | 1 + program/lib/Roundcube/bootstrap.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 6cb3d973b..8258f1de0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix exit code on bootsrap errors in CLI mode (#1489044) - Fix error handling in CLI mode, use STDERR and non-empty exit code (#1489043) - Fix error when using check_referer=true - Fix incorrect handling of some specific links (#1489060) diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index 38ef216fe..177638100 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -46,8 +46,10 @@ if (php_sapi_name() != 'cli') { foreach ($config as $optname => $optval) { if ($optval != ini_get($optname) && @ini_set($optname, $optval) === false) { - die("ERROR: Wrong '$optname' option value and it wasn't possible to set it to required value ($optval).\n" - ."Check your PHP configuration (including php_admin_flag)."); + $error = "ERROR: Wrong '$optname' option value and it wasn't possible to set it to required value ($optval).\n" + . "Check your PHP configuration (including php_admin_flag)."; + if (defined('STDERR')) fwrite(STDERR, $error); else echo $error; + exit(1); } } -- cgit v1.2.3