diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-04 15:49:22 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-04 15:49:22 +0000 |
commit | e11da225e02ae4aa353fe27d774186ae9e513648 (patch) | |
tree | 2667ecb281b12adf3584d9913d11b693aba6ece8 /phpBB/includes/functions.php | |
parent | b131931edbb9243509450302ddac27e7e310ab29 (diff) | |
download | forums-e11da225e02ae4aa353fe27d774186ae9e513648.tar forums-e11da225e02ae4aa353fe27d774186ae9e513648.tar.gz forums-e11da225e02ae4aa353fe27d774186ae9e513648.tar.bz2 forums-e11da225e02ae4aa353fe27d774186ae9e513648.tar.xz forums-e11da225e02ae4aa353fe27d774186ae9e513648.zip |
- slightly adjusted the DEBUG/DEBUG_EXTRA requirements
- changed error_reporting to E_ALL
- our error handler now takes the error_reporting value into account allowing us to correctly supress notices
git-svn-id: file:///svn/phpbb/trunk@5877 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index d4be3ec65e..bdf44d31d0 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2142,6 +2142,13 @@ function msg_handler($errno, $msg_text, $errfile, $errline) global $cache, $db, $auth, $template, $config, $user; global $phpEx, $phpbb_root_path, $starttime, $msg_title, $msg_long_text; + // Check the error reporting level and return if the error level does not match + // This also fixes the displayed notices even if we suppress them via @ + if (($errno & error_reporting()) == 0) + { + return; + } + // Message handler is stripping text. In case we need it, we are possible to define long text... if (isset($msg_long_text) && $msg_long_text && !$msg_text) { @@ -2153,7 +2160,10 @@ function msg_handler($errno, $msg_text, $errfile, $errline) case E_NOTICE: case E_WARNING: - if (defined('DEBUG_EXTRA')) + /** + * @todo Think about removing the if-condition within the final product, since we no longer enable DEBUG by default and we will maybe adjust the error reporting level + */ + if (defined('DEBUG')) { if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.php') === false) { @@ -2214,6 +2224,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) exit; break; + case E_USER_WARNING: case E_USER_NOTICE: define('IN_ERROR_HANDLER', true); @@ -2597,7 +2608,7 @@ function page_footer() $mtime = explode(' ', microtime()); $totaltime = $mtime[0] + $mtime[1] - $starttime; - if (!empty($_REQUEST['explain']) && $auth->acl_get('a_') && method_exists($db, 'sql_report')) + if (!empty($_REQUEST['explain']) && $auth->acl_get('a_') && defined('DEBUG_EXTRA') && method_exists($db, 'sql_report')) { $db->sql_report('display'); } |