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