From 8f765e50a39d79ff23d812fd3a88937f988a75ca Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 5 May 2006 12:28:38 +0000 Subject: [PATCH] - put the error reporting check into another location (since we do want to display our notices. ;)) - default error reporting in common.php - E_ALL being set if DEBUG_EXTRA defined git-svn-id: file:///svn/phpbb/trunk@5882 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/common.php | 3 +-- phpBB/includes/functions.php | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/phpBB/common.php b/phpBB/common.php index fd3d630740..88577c6971 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -23,8 +23,7 @@ if (!defined('IN_PHPBB')) $starttime = explode(' ', microtime()); $starttime = $starttime[1] + $starttime[0]; -// error_reporting(E_ERROR | E_WARNING | E_PARSE); -error_reporting(E_ALL); +error_reporting(E_ERROR | E_WARNING | E_PARSE); /* * Remove variables created by register_globals from the global scope diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index fd658bb0c4..eae12f3d07 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2152,13 +2152,6 @@ 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) { @@ -2170,14 +2163,22 @@ function msg_handler($errno, $msg_text, $errfile, $errline) case E_NOTICE: case E_WARNING: + // Check the error reporting level and return if the error level does not match + // Additionally do not display notices if we suppress them via @ + // If DEBUG_EXTRA is defined the default level is E_ALL + if (($errno & ((defined('DEBUG_EXTRA') && error_reporting()) ? E_ALL : error_reporting())) == 0) + { + return; + } + /** * @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) + if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.') === false) { - echo '[phpBB Debug Extra] PHP Notice: in file ' . str_replace(array(realpath($phpbb_root_path), '\\'), array('', '/'), $errfile) . ' on line ' . $errline . ': ' . $msg_text . '
' . "\n"; + echo '[phpBB Debug] PHP Notice: in file ' . str_replace(array(realpath($phpbb_root_path), '\\'), array('', '/'), $errfile) . ' on line ' . $errline . ': ' . $msg_text . '
' . "\n"; } }