diff options
Diffstat (limited to 'program/include/rcube.php')
-rw-r--r-- | program/include/rcube.php | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/program/include/rcube.php b/program/include/rcube.php index 272136fa8..e9add8d5a 100644 --- a/program/include/rcube.php +++ b/program/include/rcube.php @@ -1050,6 +1050,18 @@ class rcube */ public static function raise_error($arg = array(), $log = false, $terminate = false) { + // handle PHP exceptions + if (is_object($arg) && is_a($arg, 'Exception')) { + $err = array( + 'type' => 'php', + 'code' => $arg->getCode(), + 'line' => $arg->getLine(), + 'file' => $arg->getFile(), + 'message' => $arg->getMessage(), + ); + $arg = $err; + } + // installer if (class_exists('rcube_install', false)) { $rci = rcube_install::get_instance(); @@ -1057,7 +1069,8 @@ class rcube return; } - if ($log && $arg['type'] && $arg['message']) { + if (($log || $terminate) && $arg['type'] && $arg['message']) { + $arg['fatal'] = $terminate; self::log_bug($arg); } @@ -1085,7 +1098,7 @@ class rcube } // write error to local log file - if ($level & 1) { + if (($level & 1) || !empty($arg_arr['fatal'])) { if ($_SERVER['REQUEST_METHOD'] == 'POST') { $post_query = '?_task='.urlencode($_POST['_task']).'&_action='.urlencode($_POST['_action']); } |