From a4b32a9ab6e30d0b35d614d446b86923e1f6ccc2 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Thu, 30 Oct 2008 16:17:37 +0000 Subject: [PATCH] Make getSubjectPage return $this if the title is the same. This avoids process cache loss. --- includes/Title.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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() ); } /** -- 2.20.1