* Make $wgSiteNotice value wikitext again, for consistency with editable
authorBrion Vibber <brion@users.mediawiki.org>
Sat, 16 Dec 2006 09:13:43 +0000 (09:13 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sat, 16 Dec 2006 09:13:43 +0000 (09:13 +0000)
  MediaWiki:Sitenotice and MediaWiki:Anonnotice.

RELEASE-NOTES
includes/GlobalFunctions.php

index 83449e0..b4171fd 100644 (file)
@@ -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 ==
index a90e386..b81ffb0 100644 (file)
@@ -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 ) );