From 05067682dfbbfef707ee7fb5f77113c984d2bbe4 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 27 Jun 2005 07:23:18 +0000 Subject: [PATCH] * Fix $wgSiteNotice when MediaWiki:Sitenotice is set to default '-' --- RELEASE-NOTES | 2 +- includes/GlobalFunctions.php | 23 +++++++++++------------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index cc9483a151..56738e237c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 71163d3e46..1af8091ae4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1117,19 +1117,18 @@ function wfGetSiteNotice() { wfProfileIn( $fname ); $notice = wfMsg( 'sitenotice' ); - if($notice == '<sitenotice>') $notice = ''; - # Allow individual wikis to turn it off - if ( $notice == '-' ) { + if( $notice == '<sitenotice>' || $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; -- 2.20.1