X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ftitle%2FSubpageImportTitleFactory.php;h=415196a5ef271408b3ffe58d493f47338fd12b6e;hb=7baed424895d4fe38aa8a7215384724685eca88f;hp=42443503072628fe0b26a131a5ab8c182f20c7b7;hpb=925c20a9ca669c67cc44f4468d0e0f3b33b94213;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/title/SubpageImportTitleFactory.php b/includes/title/SubpageImportTitleFactory.php index 4244350307..415196a5ef 100644 --- a/includes/title/SubpageImportTitleFactory.php +++ b/includes/title/SubpageImportTitleFactory.php @@ -18,6 +18,8 @@ * @file */ +use MediaWiki\MediaWikiServices; + /** * A class to convert page titles on a foreign wiki (ForeignTitle objects) into * page titles on the local wiki (Title objects), placing all pages as subpages @@ -32,7 +34,10 @@ class SubpageImportTitleFactory implements ImportTitleFactory { * created */ public function __construct( Title $rootPage ) { - if ( !MWNamespace::hasSubpages( $rootPage->getNamespace() ) ) { + if ( + !MediaWikiServices::getInstance()->getNamespaceInfo()-> + hasSubpages( $rootPage->getNamespace() ) + ) { throw new MWException( "The root page you specified, $rootPage, is in a " . "namespace where subpages are not allowed" ); }