Possible error messages for action=createaccount should be in English and not show...
authorKunal Mehta <legoktm@gmail.com>
Mon, 22 Jul 2013 09:44:03 +0000 (02:44 -0700)
committerKunal Mehta <legoktm@gmail.com>
Mon, 22 Jul 2013 09:44:03 +0000 (02:44 -0700)
Bug: 47791
Change-Id: Id55f65d1a7b9b2d6a17da0b87bffe42ceb4231ef

includes/api/ApiCreateAccount.php

index 9464d49..201634d 100644 (file)
@@ -250,7 +250,7 @@ class ApiCreateAccount extends ApiBase {
                $errors = parent::getPossibleErrors();
                // All local errors are from LoginForm, which means they're actually message keys.
                foreach ( $localErrors as $error ) {
-                       $errors[] = array( 'code' => $error, 'info' => wfMessage( $error )->parse() );
+                       $errors[] = array( 'code' => $error, 'info' => wfMessage( $error )->inLanguage( 'en' )->useDatabase( false )->parse() );
                }
 
                $errors[] = array(
@@ -274,7 +274,7 @@ class ApiCreateAccount extends ApiBase {
                global $wgMinimalPasswordLength;
                $errors[] = array(
                        'code' => 'passwordtooshort',
-                       'info' => wfMessage( 'passwordtooshort', $wgMinimalPasswordLength )->parse()
+                       'info' => wfMessage( 'passwordtooshort', $wgMinimalPasswordLength )->inLanguage( 'en' )->useDatabase( false )->parse()
                );
                return $errors;
        }