From ec2b295ba5204473df589526d488667211c54140 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 22 Jan 2006 12:38:13 +0000 Subject: [PATCH] * wfGetSiteNotice() gets called on DB errors (wtf?) so depending on $wgUser which depends on the database for this executing successfully is not a very good idea... --- includes/GlobalFunctions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 5b4d8bc869..ceb5fa9326 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1396,7 +1396,7 @@ function wfGetSiteNotice() { $fname = 'wfGetSiteNotice'; wfProfileIn( $fname ); - if( $wgUser->isLoggedIn() ) { + if( is_object( $wgUser ) && $wgUser->isLoggedIn() ) { $siteNotice = wfGetCachedNotice( 'sitenotice' ); $siteNotice = !$siteNotice ? $wgSiteNotice : $siteNotice; } else { -- 2.20.1