diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-01-12 22:30:23 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-01-12 22:30:23 -0500 |
commit | c3aa466523e9b074bc4479eccc7b0514972f4b28 (patch) | |
tree | a73ef6d6d67c95a27e88314f054547ce61e58d5c | |
parent | 466acfdd943e37a3e1d98b12143894274fea9143 (diff) | |
parent | d7aa3aab5e40747e71d091d8033207f4363fb59c (diff) | |
download | forums-c3aa466523e9b074bc4479eccc7b0514972f4b28.tar forums-c3aa466523e9b074bc4479eccc7b0514972f4b28.tar.gz forums-c3aa466523e9b074bc4479eccc7b0514972f4b28.tar.bz2 forums-c3aa466523e9b074bc4479eccc7b0514972f4b28.tar.xz forums-c3aa466523e9b074bc4479eccc7b0514972f4b28.zip |
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
-rw-r--r-- | phpBB/includes/db/dbal.php | 5 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 48626af050..8564cb8426 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -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 { diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 753795b7cf..a60edb5cee 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -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); } |