Merge "Always preserve uselang in login form"
[lhc/web/wiklou.git] / includes / specials / SpecialEmailuser.php
index 06be7bc..a550e88 100644 (file)
@@ -20,6 +20,7 @@
  * @file
  * @ingroup SpecialPage
  */
+use MediaWiki\MediaWikiServices;
 
 /**
  * A special page that allows users to send e-mails to other users
@@ -223,7 +224,7 @@ class SpecialEmailUser extends UnlistedSpecialPage {
        public static function getPermissionsError( $user, $editToken, Config $config = null ) {
                if ( $config === null ) {
                        wfDebug( __METHOD__ . ' called without a Config instance passed to it' );
-                       $config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' );
+                       $config = MediaWikiServices::getInstance()->getMainConfig();
                }
                if ( !$config->get( 'EnableEmail' ) || !$config->get( 'EnableUserEmail' ) ) {
                        return 'usermaildisabled';