CoreParserFunctions: Use Title::inNamespace instead of manual comparison

Change-Id: I60c02bc68ef0d48b1dc66ba0961275feec5789fb
This commit is contained in:
Niklas Laxström 2016-12-21 10:54:33 +01:00
parent af614d2c3b
commit c9d638d6c7

View file

@ -276,7 +276,7 @@ class CoreParserFunctions {
}
if ( !is_null( $title ) ) {
# Convert NS_MEDIA -> NS_FILE
if ( $title->getNamespace() == NS_MEDIA ) {
if ( $title->inNamespace( NS_MEDIA ) ) {
$title = Title::makeTitle( NS_FILE, $title->getDBkey() );
}
if ( !is_null( $arg ) ) {
@ -341,7 +341,7 @@ class CoreParserFunctions {
// allow prefix.
$title = Title::newFromText( $username );
if ( $title && $title->getNamespace() == NS_USER ) {
if ( $title && $title->inNamespace( NS_USER ) ) {
$username = $title->getText();
}