From dc0ee24c48972aba136bf9bdea510fde98ea6955 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Sun, 8 Mar 2009 17:15:57 +0000 Subject: [PATCH] (bug 17860) Moving a page in the "MediaWiki" namespace using SuppressRedirect no longer corrupts the message cache --- RELEASE-NOTES | 2 ++ includes/Title.php | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7b37b3612a..39f302c588 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 diff --git a/includes/Title.php b/includes/Title.php index 5b3916ac31..a6fd58a194 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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() ); } -- 2.20.1