CoreParserFunctions: Use Title::inNamespace instead of manual comparison
Change-Id: I60c02bc68ef0d48b1dc66ba0961275feec5789fb
This commit is contained in:
parent
af614d2c3b
commit
c9d638d6c7
1 changed files with 2 additions and 2 deletions
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue