Merge "title: Convert binary regexp to use Unicode code points"
[lhc/web/wiklou.git] / includes / installer / WebInstallerName.php
index 09fc0f3..1222ac2 100644 (file)
@@ -19,6 +19,8 @@
  * @ingroup Deployment
  */
 
+use MediaWiki\MediaWikiServices;
+
 class WebInstallerName extends WebInstallerPage {
 
        /**
@@ -26,10 +28,8 @@ class WebInstallerName extends WebInstallerPage {
         */
        public function execute() {
                $r = $this->parent->request;
-               if ( $r->wasPosted() ) {
-                       if ( $this->submit() ) {
-                               return 'continue';
-                       }
+               if ( $r->wasPosted() && $this->submit() ) {
+                       return 'continue';
                }
 
                $this->startForm();
@@ -186,8 +186,7 @@ class WebInstallerName extends WebInstallerPage {
                }
 
                // Make sure it won't conflict with any existing namespaces
-               global $wgContLang;
-               $nsIndex = $wgContLang->getNsIndex( $name );
+               $nsIndex = MediaWikiServices::getInstance()->getContentLanguage()->getNsIndex( $name );
                if ( $nsIndex !== false && $nsIndex !== NS_PROJECT ) {
                        $this->parent->showError( 'config-ns-conflict', $name );
                        $retVal = false;