* Fix raw sitenotice display on database error
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 22 Dec 2005 06:30:39 +0000 (06:30 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 22 Dec 2005 06:30:39 +0000 (06:30 +0000)
RELEASE-NOTES
includes/Database.php
includes/GlobalFunctions.php

index 837d51a..c481ca3 100644 (file)
@@ -345,6 +345,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 675) Add page protection level for unregistered/new accounts
 * User::isNewbie now uses the registration date and $wgAutoconfirmAge
 * Log views show message when no matches
+* Fix raw sitenotice display on database error
 
 
 === Caveats ===
index df56815..9dc7bd3 100644 (file)
@@ -1797,11 +1797,8 @@ border=\"0\" ALT=\"Google\"></A>
 
        wfLogDBError( "Connection error: $error\n" );
        
-       $msg = wfGetSiteNotice();
-       if($msg == '') {
-               $msg = str_replace( '$1', $error, $noconnect );
-       }
-       $text = $msg;
+       $text = str_replace( '$1', $error, $noconnect );
+       $text .= wfGetSiteNotice();
 
        if($wgUseFileCache) {
                if($wgTitle) {
index 8b97d8d..7bfa34a 100644 (file)
@@ -1298,7 +1298,12 @@ function wfGetSiteNotice() {
                $notice = $wgSiteNotice;
        }
        if($notice != '-' && $notice != '') {
-               $notice = $wgOut->parse( $notice );
+               if( is_object( $wgOut ) ) {
+                       $notice = $wgOut->parse( $notice );
+               } else {
+                       wfDebug( "wfGetSiteNotice called with no \$wgOut available" );
+                       $notice = '';
+               }
        }
        wfProfileOut( $fname );
        return $notice;