From a9fb3b981b1b1bcdcbdf124baf4fbf7b211d3717 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 16 Dec 2006 09:13:43 +0000 Subject: [PATCH] * Make $wgSiteNotice value wikitext again, for consistency with editable MediaWiki:Sitenotice and MediaWiki:Anonnotice. --- RELEASE-NOTES | 2 ++ includes/GlobalFunctions.php | 24 ++++++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 83449e07d2..b4171fd22d 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -320,6 +320,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN this makes it consistent with WebRequest::get* methods. Corrected code in various places accordingly. * (bug 8264) Fix JavaScript global vars for XHTML mode +* Make $wgSiteNotice value wikitext again, for consistency with editable + MediaWiki:Sitenotice and MediaWiki:Anonnotice. == Languages updated == diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index a90e386581..b81ffb0039 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1446,10 +1446,21 @@ function wfGetCachedNotice( $name ) { wfProfileIn( $fname ); $needParse = false; - $notice = wfMsgForContent( $name ); - if( wfEmptyMsg( $name, $notice ) || $notice == '-' ) { - wfProfileOut( $fname ); - return( false ); + + if( $name === 'default' ) { + // special case + global $wgSiteNotice; + $notice = $wgSiteNotice; + if( empty( $notice ) ) { + wfProfileOut( $fname ); + return false; + } + } else { + $notice = wfMsgForContent( $name ); + if( wfEmptyMsg( $name, $notice ) || $notice == '-' ) { + wfProfileOut( $fname ); + return( false ); + } } $cachedNotice = $parserMemc->get( wfMemcKey( $name ) ); @@ -1509,16 +1520,17 @@ function wfGetSiteNotice() { if( wfRunHooks( 'SiteNoticeBefore', array( &$siteNotice ) ) ) { if( is_object( $wgUser ) && $wgUser->isLoggedIn() ) { $siteNotice = wfGetCachedNotice( 'sitenotice' ); - $siteNotice = !$siteNotice ? $wgSiteNotice : $siteNotice; } else { $anonNotice = wfGetCachedNotice( 'anonnotice' ); if( !$anonNotice ) { $siteNotice = wfGetCachedNotice( 'sitenotice' ); - $siteNotice = !$siteNotice ? $wgSiteNotice : $siteNotice; } else { $siteNotice = $anonNotice; } } + if( !$siteNotice ) { + $siteNotice = wfGetCachedNotice( 'default' ); + } } wfRunHooks( 'SiteNoticeAfter', array( &$siteNotice ) ); -- 2.20.1