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";
}
}