* wfGetSiteNotice() gets called on DB errors (wtf?) so depending on $wgUser
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 22 Jan 2006 12:38:13 +0000 (12:38 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Sun, 22 Jan 2006 12:38:13 +0000 (12:38 +0000)
  which depends on the database for this executing successfully is not a very
  good idea...

includes/GlobalFunctions.php

index 5b4d8bc..ceb5fa9 100644 (file)
@@ -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 {