1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-06-02 04:24:56 +02:00

Merge branch 'develop-olympus' into develop

* develop-olympus:
  [ticket/9079] Always log backtrace to error log when logging errors.
  [ticket/9079] Display backtrace on all E_USER_ERROR errors, not only SQL errors
This commit is contained in:
Oleg Pudeyev 2012-01-12 22:30:23 -05:00
commit c3aa466523
2 changed files with 13 additions and 6 deletions

View File

@ -683,12 +683,7 @@ class dbal
// The DEBUG_EXTRA constant is for development only!
if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA'))
{
// Print out a nice backtrace...
$backtrace = get_backtrace();
$message .= ($sql) ? '<br /><br />SQL<br /><br />' . htmlspecialchars($sql) : '';
$message .= ($backtrace) ? '<br /><br />BACKTRACE<br />' . $backtrace : '';
$message .= '<br />';
}
else
{

View File

@ -3796,11 +3796,23 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
}
}
$log_text = $msg_text;
$backtrace = get_backtrace();
if ($backtrace)
{
$log_text .= '<br /><br />BACKTRACE<br />' . $backtrace;
}
if (defined('IN_INSTALL') || defined('DEBUG_EXTRA') || isset($auth) && $auth->acl_get('a_'))
{
$msg_text = $log_text;
}
if ((defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db))
{
// let's avoid loops
$db->sql_return_on_error(true);
add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $msg_text);
add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $log_text);
$db->sql_return_on_error(false);
}