From c9d638d6c7c157895a5a9c44ef57844932848159 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Wed, 21 Dec 2016 10:54:33 +0100 Subject: [PATCH] CoreParserFunctions: Use Title::inNamespace instead of manual comparison Change-Id: I60c02bc68ef0d48b1dc66ba0961275feec5789fb --- includes/parser/CoreParserFunctions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); } -- 2.20.1