diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 10cbc4f2d2..d360efa7d9 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1535,16 +1535,19 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
{
case E_NOTICE:
case E_WARNING:
+
if (defined('DEBUG_EXTRA'))
{
- if (!strstr($errfile, 'cache') && !strstr($errfile, 'template.php'))
+ if (strpos($errfile, 'cache') === false && strpos($errfile, 'template.php') === false)
{
echo "PHP Notice: in file $errfile on line $errline: $msg_text
";
}
}
- break;
+
+ break;
case E_USER_ERROR:
+
if (isset($db))
{
$db->sql_close();
@@ -1583,14 +1586,14 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
echo ' ';
echo ' ';
echo '