Reset the message cache on action=purge of a MediaWiki namespace page. Delete the...
authorTim Starling <tstarling@users.mediawiki.org>
Sat, 9 Feb 2008 10:01:35 +0000 (10:01 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sat, 9 Feb 2008 10:01:35 +0000 (10:01 +0000)
includes/Article.php
includes/MessageCache.php

index 3f17c01..188aee1 100644 (file)
@@ -978,6 +978,11 @@ class Article {
                        $update = SquidUpdate::newSimplePurge( $this->mTitle );
                        $update->doUpdate();
                }
+               if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
+                       global $wgMessageCache;
+                       $text = $this->getContent();
+                       $wgMessageCache->replace( $this->mTitle->getDBkey(), $text );
+               }
                $this->view();
        }
 
index 743bd7f..976cd96 100644 (file)
@@ -348,7 +348,6 @@ class MessageCache {
                wfProfileIn( __METHOD__ );
                $this->lock();
                $this->load();
-               $parserMemc->delete(wfMemcKey('sidebar'));
                if ( is_array( $this->mCache ) ) {
                        if ( $text === false ) {
                                # Article was deleted
@@ -376,6 +375,7 @@ class MessageCache {
                        }
                }
                $this->unlock();
+               $parserMemc->delete(wfMemcKey('sidebar'));
                wfProfileOut( __METHOD__ );
        }