diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-01-12 22:28:45 -0500 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-01-12 22:28:45 -0500 |
commit | d7aa3aab5e40747e71d091d8033207f4363fb59c (patch) | |
tree | df4beab692d2a8a9301e5250c91076e1c4cb4558 /phpBB/includes | |
parent | 95a74c7472ffa56d5fdcbbc2ec883d9f24db1037 (diff) | |
parent | b6999237f456443b0b325f2ebee1f990ee7f5116 (diff) | |
download | forums-d7aa3aab5e40747e71d091d8033207f4363fb59c.tar forums-d7aa3aab5e40747e71d091d8033207f4363fb59c.tar.gz forums-d7aa3aab5e40747e71d091d8033207f4363fb59c.tar.bz2 forums-d7aa3aab5e40747e71d091d8033207f4363fb59c.tar.xz forums-d7aa3aab5e40747e71d091d8033207f4363fb59c.zip |
Merge remote-tracking branch 'bantu/ticket/9079' into develop-olympus
* bantu/ticket/9079:
[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
Diffstat (limited to 'phpBB/includes')
-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 b4c1a72e1c..230c9c8ed7 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -662,12 +662,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 852fc683f2..1eefaee651 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3853,11 +3853,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); } |