From efad1f2491413b1609577f59a94987492fd6fe76 Mon Sep 17 00:00:00 2001 From: Bart van Bragt Date: Mon, 25 Nov 2002 18:32:36 +0000 Subject: [PATCH] Made the error handler behave responsibly when $user isn't there yet git-svn-id: file:///svn/phpbb/trunk@3092 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 2e022b8966..cc321003ca 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -797,6 +797,15 @@ function msg_handler($errno, $msg_text, $errfile, $errline) break; case E_USER_NOTICE: + // 20021125 Bartvb (todo) + // This is a hack just to show something useful. + // $msg_text won't contain anything if $user isn't there yet. + // I ran into this problem when installing without makeing config_cache.php writable + if ( !class_exists($user) ) + { + die("Unable to show notice, \$user class hasn't been instantiated yet.
Error triggered in: " . $errfile .":". $errline); + } + if (empty($user->session_id)) { $user->start(); @@ -842,4 +851,4 @@ function msg_handler($errno, $msg_text, $errfile, $errline) } } -?> \ No newline at end of file +?>