Also delete the page information cache when invalidating cache of a non-existing...
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Wed, 26 Dec 2012 19:50:38 +0000 (20:50 +0100)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Wed, 26 Dec 2012 19:50:38 +0000 (20:50 +0100)
Changed the usage of WikiPage::getRevision() to Title::getLatestRevID(), so that
the cache is correctly deleted when the page does not exist and it doesn't need
to create an instance of the WikiPage class to get an already-available value.

Change-Id: Ied4dedd051759503046d5461c640de3490d29c91

includes/Title.php

index a20367d..f045f74 100644 (file)
@@ -4476,11 +4476,8 @@ class Title {
                HTMLFileCache::clearFileCache( $this );
 
                // Clear page info.
-               $revision = WikiPage::factory( $this )->getRevision();
-               if( $revision !== null ) {
-                       $memcKey = wfMemcKey( 'infoaction', $this->getPrefixedText(), $revision->getId() );
-                       $success = $success && $wgMemc->delete( $memcKey );
-               }
+               $memcKey = wfMemcKey( 'infoaction', $this->getPrefixedText(), $this->getLatestRevID() );
+               $success = $success && $wgMemc->delete( $memcKey );
 
                return $success;
        }