r95949 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95948‎ | r95949 | r95950 >
Date:08:34, 1 September 2011
Author:dantman
Status:ok
Tags:
Comment:
Followup r95947, undo accidental revert of r95946.
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -3861,6 +3861,18 @@
38623862 }
38633863
38643864 /**
 3865+ * Check if this title is a subpage of another title
 3866+ *
 3867+ * @param $title Title
 3868+ * @return Bool
 3869+ */
 3870+ public function isSubpageOf( Title $title ) {
 3871+ return $this->getInterwiki() === $title->getInterwiki()
 3872+ && $this->getNamespace() == $title->getNamespace()
 3873+ && strpos( $this->getDBkey(), $title->getDBkey() . '/' ) === 0;
 3874+ }
 3875+
 3876+ /**
38653877 * Callback for usort() to do title sorts by (namespace, title)
38663878 *
38673879 * @param $a Title

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95946Add Title::isSubpageOf to use when you want to make tests like $title->isSubp...dantman07:49, 1 September 2011
r95947Fix indentation in r95396catrope08:21, 1 September 2011

Status & tagging log