From: Leon Weber Date: Tue, 12 Dec 2006 19:14:29 +0000 (+0000) Subject: Added Title::isSubpage() X-Git-Tag: 1.31.0-rc.0~54923 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22articles%22%2C%22id_article=%24id_article%22%29%20.%20%22?a=commitdiff_plain;h=e16e1e898c8656d74046623f4b3b62b304c60b6f;p=lhc%2Fweb%2Fwiklou.git Added Title::isSubpage() --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e187f42daa..72ffd6296b 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -292,7 +292,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * User::setPassword() now throws PasswordError exceptions if the password is illegal or cannot be set via $wgAuth. These can be caught and a human- readable error message displayed by UI code. - +* Added Title::isSubpage() == Languages updated == diff --git a/includes/Title.php b/includes/Title.php index c52ea244c2..dce53d1e73 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -1217,6 +1217,16 @@ class Title { return Namespace::isTalk( $this->getNamespace() ); } + /** + * Is this a subpage? + * @return bool + * @access public + */ + function isSubpage() { + global $wgNamespacesWithSubpages; + return ( strpos( $this->getText(), '/' ) !== false && $wgNamespacesWithSubpages[ $this->mNamespace ] == true ); + } + /** * Is this a .css or .js subpage of a user page? * @return bool