Make getSubjectPage return $this if the title is the same. This avoids process cache...
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 30 Oct 2008 16:17:37 +0000 (16:17 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 30 Oct 2008 16:17:37 +0000 (16:17 +0000)
includes/Title.php

index 53ba1d0..eb9e2b1 100644 (file)
@@ -2258,7 +2258,12 @@ class Title {
         * @return \type{Title} the object for the subject page
         */
        public function getSubjectPage() {
-               return Title::makeTitle( MWNamespace::getSubject( $this->getNamespace() ), $this->getDBkey() );
+               // Is this the same title?
+               $subjectNS = MWNamespace::getSubject( $this->getNamespace() );
+               if( $this->getNamespace() == $subjectNS ) {
+                       return $this;
+               }
+               return Title::makeTitle( $subjectNS, $this->getDBkey() );
        }
 
        /**