(bug 17860) Moving a page in the "MediaWiki" namespace using SuppressRedirect no...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 8 Mar 2009 17:15:57 +0000 (17:15 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 8 Mar 2009 17:15:57 +0000 (17:15 +0000)
RELEASE-NOTES
includes/Title.php

index 7b37b36..39f302c 100644 (file)
@@ -249,6 +249,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 17799) Special:Random no longer throws a database error when a non-
   namespace is given, silently falls back to NS_MAIN
 * (bug 17751) The message for bad titles in WantedPages is now localized
+* (bug 17860) Moving a page in the "MediaWiki" namespace using SuppressRedirect
+  no longer corrupts the message cache
 
 == API changes in 1.15 ==
 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions
index 5b3916a..a6fd58a 100644 (file)
@@ -2760,8 +2760,16 @@ class Title {
                # Update message cache for interface messages
                if( $nt->getNamespace() == NS_MEDIAWIKI ) {
                        global $wgMessageCache;
-                       $oldarticle = new Article( $this );
-                       $wgMessageCache->replace( $this->getDBkey(), $oldarticle->getContent() );
+
+                       # @bug 17860: old article can be deleted, if this the case,
+                       # delete it from message cache
+                       if ( $this->getArticleID === 0 ) {
+                               $wgMessageCache->replace( $this->getDBkey(), false );
+                       } else {
+                               $oldarticle = new Article( $this );
+                               $wgMessageCache->replace( $this->getDBkey(), $oldarticle->getContent() );
+                       }
+
                        $newarticle = new Article( $nt );
                        $wgMessageCache->replace( $nt->getDBkey(), $newarticle->getContent() );
                }