From: Daniel Friesen Date: Thu, 1 Sep 2011 08:34:29 +0000 (+0000) Subject: Followup r95947, undo accidental revert of r95946. X-Git-Tag: 1.31.0-rc.0~27984 X-Git-Url: http://git.cyclocoop.org/data/Fool?a=commitdiff_plain;h=2b84c8e8e2f7647d30e069dfe485406d5067bde4;p=lhc%2Fweb%2Fwiklou.git Followup r95947, undo accidental revert of r95946. --- 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) *