From 2b84c8e8e2f7647d30e069dfe485406d5067bde4 Mon Sep 17 00:00:00 2001 From: Daniel Friesen Date: Thu, 1 Sep 2011 08:34:29 +0000 Subject: [PATCH] Followup r95947, undo accidental revert of r95946. --- includes/Title.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/includes/Title.php b/includes/Title.php index 932e56cbcb..56713cdf5d 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -3860,6 +3860,18 @@ class Title { && $this->getDBkey() === $title->getDBkey(); } + /** + * Check if this title is a subpage of another title + * + * @param $title Title + * @return Bool + */ + public function isSubpageOf( Title $title ) { + return $this->getInterwiki() === $title->getInterwiki() + && $this->getNamespace() == $title->getNamespace() + && strpos( $this->getDBkey(), $title->getDBkey() . '/' ) === 0; + } + /** * Callback for usort() to do title sorts by (namespace, title) * -- 2.20.1