|
|
@ -1352,7 +1352,7 @@ class rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Report error according to configured debug_level
|
|
|
|
* Log an error
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param array $arg_arr Named parameters
|
|
|
|
* @param array $arg_arr Named parameters
|
|
|
|
* @see self::raise_error()
|
|
|
|
* @see self::raise_error()
|
|
|
@ -1360,15 +1360,8 @@ class rcube
|
|
|
|
public static function log_bug($arg_arr)
|
|
|
|
public static function log_bug($arg_arr)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$program = strtoupper($arg_arr['type'] ?: 'php');
|
|
|
|
$program = strtoupper($arg_arr['type'] ?: 'php');
|
|
|
|
$level = self::get_instance()->config->get('debug_level');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// disable errors for ajax requests, write to log instead (#1487831)
|
|
|
|
|
|
|
|
if (($level & 4) && !empty($_REQUEST['_remote'])) {
|
|
|
|
|
|
|
|
$level = ($level ^ 4) | 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// write error to local log file
|
|
|
|
// write error to local log file
|
|
|
|
if (($level & 1) || !empty($arg_arr['fatal'])) {
|
|
|
|
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|
|
|
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
|
|
|
|
foreach (array('_task', '_action') as $arg) {
|
|
|
|
foreach (array('_task', '_action') as $arg) {
|
|
|
|
if ($_POST[$arg] && !$_GET[$arg]) {
|
|
|
|
if ($_POST[$arg] && !$_GET[$arg]) {
|
|
|
@ -1395,26 +1388,6 @@ class rcube
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// report the bug to the global bug reporting system
|
|
|
|
|
|
|
|
if ($level & 2) {
|
|
|
|
|
|
|
|
// TODO: Send error via HTTP
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// show error if debug_mode is on
|
|
|
|
|
|
|
|
if ($level & 4) {
|
|
|
|
|
|
|
|
print "<b>$program Error";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!empty($arg_arr['file']) && !empty($arg_arr['line'])) {
|
|
|
|
|
|
|
|
print " in $arg_arr[file] ($arg_arr[line])";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print ':</b> ';
|
|
|
|
|
|
|
|
print nl2br($arg_arr['message']);
|
|
|
|
|
|
|
|
print '<br />';
|
|
|
|
|
|
|
|
flush();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Write debug info to the log
|
|
|
|
* Write debug info to the log
|
|
|
|
*
|
|
|
|
*
|
|
|
|