From: Niklas Laxström Date: Wed, 21 Dec 2016 09:54:33 +0000 (+0100) Subject: CoreParserFunctions: Use Title::inNamespace instead of manual comparison X-Git-Tag: 1.31.0-rc.0~4492^2 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=c9d638d6c7c157895a5a9c44ef57844932848159;p=lhc%2Fweb%2Fwiklou.git CoreParserFunctions: Use Title::inNamespace instead of manual comparison Change-Id: I60c02bc68ef0d48b1dc66ba0961275feec5789fb --- diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 51cb410f3c..6aa3accebe 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -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(); }