Followup r95947, undo accidental revert of r95946.
authorDaniel Friesen <dantman@users.mediawiki.org>
Thu, 1 Sep 2011 08:34:29 +0000 (08:34 +0000)
committerDaniel Friesen <dantman@users.mediawiki.org>
Thu, 1 Sep 2011 08:34:29 +0000 (08:34 +0000)
includes/Title.php

index 932e56c..56713cd 100644 (file)
@@ -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)
         *