From e11da225e02ae4aa353fe27d774186ae9e513648 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 4 May 2006 15:49:22 +0000 Subject: [PATCH] - 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 --- phpBB/adm/index.php | 4 ++-- phpBB/common.php | 5 +++-- phpBB/includes/functions.php | 15 +++++++++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 5a36a9e03e..40f46dc5b8 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -149,12 +149,12 @@ function adm_page_footer($copyright_html = true) $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'); } - $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off' ) . ' | Load : ' . (($user->load) ? $user->load : 'N/A'), $totaltime); + $debug_output = sprintf('Time : %.3fs | ' . $db->sql_num_queries() . ' Queries | GZIP : ' . (($config['gzip_compress']) ? 'On' : 'Off') . (($user->load) ? ' | Load : ' . $user->load : ''), $totaltime); if ($auth->acl_get('a_') && defined('DEBUG_EXTRA')) { diff --git a/phpBB/common.php b/phpBB/common.php index 88577c6971..efb86f12d6 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -11,7 +11,7 @@ // Remove the following line to enable this software, be sure you note what it // says before continuing -die('This software is unsupported in any and all respects. By removing this notice (found in common.php) you are noting your acceptance of this. Do not ask support questions of any kind for this release at either area51.phpbb.com or www.phpbb.com. Support for this version will appear when the beta cycle begins'); +//die('This software is unsupported in any and all respects. By removing this notice (found in common.php) you are noting your acceptance of this. Do not ask support questions of any kind for this release at either area51.phpbb.com or www.phpbb.com. Support for this version will appear when the beta cycle begins'); /** */ @@ -23,7 +23,8 @@ if (!defined('IN_PHPBB')) $starttime = explode(' ', microtime()); $starttime = $starttime[1] + $starttime[0]; -error_reporting(E_ERROR | E_WARNING | E_PARSE); +// error_reporting(E_ERROR | E_WARNING | E_PARSE); +error_reporting(E_ALL); /* * Remove variables created by register_globals from the global scope 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'); }