* Fix $wgSiteNotice when MediaWiki:Sitenotice is set to default '-'
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 27 Jun 2005 07:23:18 +0000 (07:23 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 27 Jun 2005 07:23:18 +0000 (07:23 +0000)
RELEASE-NOTES
includes/GlobalFunctions.php

index cc9483a..56738e2 100644 (file)
@@ -389,7 +389,7 @@ Various bugfixes, small features, and a few experimental things:
   LoginForm::addNewAccountInternal() to two new functions,
   User::isValidUserName() and User::isValidPassword(), extensions can now do
   these checks without rewriting code.
-
+* Fix $wgSiteNotice when MediaWiki:Sitenotice is set to default '-'
 
 === Caveats ===
 
index 71163d3..1af8091 100644 (file)
@@ -1117,19 +1117,18 @@ function wfGetSiteNotice() {
        wfProfileIn( $fname );
 
        $notice = wfMsg( 'sitenotice' );
-       if($notice == '&lt;sitenotice&gt;') $notice = '';
-       # Allow individual wikis to turn it off
-       if ( $notice == '-' ) {
+       if( $notice == '&lt;sitenotice&gt;' || $notice == '-' ) {
                $notice = '';
-       } else {
-               if ($notice == '') {
-                       $notice = $wgSiteNotice;
-               }
-               if($notice != '-' && $notice != '') {
-                       $specialparser = new Parser();
-                       $parserOutput = $specialparser->parse( $notice, $wgTitle, $wgOut->mParserOptions, false );
-                       $notice = $parserOutput->getText();
-               }
+       }
+       if( $notice == '' ) {
+               # We may also need to override a message with eg downtime info
+               # FIXME: make this work!
+               $notice = $wgSiteNotice;
+       }
+       if($notice != '-' && $notice != '') {
+               $specialparser = new Parser();
+               $parserOutput = $specialparser->parse( $notice, $wgTitle, $wgOut->mParserOptions, false );
+               $notice = $parserOutput->getText();
        }
        wfProfileOut( $fname );
        return $notice;