From: Aaron Schulz Date: Thu, 30 Oct 2008 16:17:37 +0000 (+0000) Subject: Make getSubjectPage return $this if the title is the same. This avoids process cache... X-Git-Tag: 1.31.0-rc.0~44503 X-Git-Url: http://git.cyclocoop.org/fichier?a=commitdiff_plain;h=a4b32a9ab6e30d0b35d614d446b86923e1f6ccc2;p=lhc%2Fweb%2Fwiklou.git Make getSubjectPage return $this if the title is the same. This avoids process cache loss. --- diff --git a/includes/Title.php b/includes/Title.php index 53ba1d05da..eb9e2b132a 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -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() ); } /**