dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Actually assign suppression-related rights to 'suppress' group"
[lhc/web/wiklou.git]
/
includes
/
title
/
NaiveForeignTitleFactory.php
diff --git
a/includes/title/NaiveForeignTitleFactory.php
b/includes/title/NaiveForeignTitleFactory.php
index
2c2f94b
..
307050b
100644
(file)
--- a/
includes/title/NaiveForeignTitleFactory.php
+++ b/
includes/title/NaiveForeignTitleFactory.php
@@
-16,9
+16,10
@@
* http://www.gnu.org/copyleft/gpl.html
*
* @file
* http://www.gnu.org/copyleft/gpl.html
*
* @file
- * @license GPL 2+
*/
*/
+use MediaWiki\MediaWikiServices;
+
/**
* A parser that translates page titles on a foreign wiki into ForeignTitle
* objects, with no knowledge of the namespace setup on the foreign site.
/**
* A parser that translates page titles on a foreign wiki into ForeignTitle
* objects, with no knowledge of the namespace setup on the foreign site.
@@
-43,8
+44,6
@@
class NaiveForeignTitleFactory implements ForeignTitleFactory {
public function createForeignTitle( $title, $ns = null ) {
$pieces = explode( ':', $title, 2 );
public function createForeignTitle( $title, $ns = null ) {
$pieces = explode( ':', $title, 2 );
- global $wgContLang;
-
/**
* Can we assume that the part of the page title before the colon is a
* namespace name?
/**
* Can we assume that the part of the page title before the colon is a
* namespace name?
@@
-57,9
+56,10
@@
class NaiveForeignTitleFactory implements ForeignTitleFactory {
* ID, we fall back to using the local wiki's namespace names to resolve
* this -- better than nothing, and mimics the old crappy behavior
*/
* ID, we fall back to using the local wiki's namespace names to resolve
* this -- better than nothing, and mimics the old crappy behavior
*/
- $isNamespacePartValid = is_null( $ns ) ?
- ( $wgContLang->getNsIndex( $pieces[0] ) !== false ) :
- $ns != 0;
+ $isNamespacePartValid = is_null( $ns )
+ ? MediaWikiServices::getInstance()->getContentLanguage()->getNsIndex( $pieces[0] ) !==
+ false
+ : $ns != 0;
if ( count( $pieces ) === 2 && $isNamespacePartValid ) {
list( $namespaceName, $pageName ) = $pieces;
if ( count( $pieces ) === 2 && $isNamespacePartValid ) {
list( $namespaceName, $pageName ) = $pieces;