Merge "Add CollationFa"
[lhc/web/wiklou.git] / includes / api / ApiLinkAccount.php
index 14347d8..9a21e76 100644 (file)
@@ -21,7 +21,6 @@
  */
 
 use MediaWiki\Auth\AuthManager;
-use MediaWiki\Auth\AuthenticationRequest;
 use MediaWiki\Auth\AuthenticationResponse;
 
 /**
@@ -50,7 +49,7 @@ class ApiLinkAccount extends ApiBase {
 
        public function execute() {
                if ( !$this->getUser()->isLoggedIn() ) {
-                       $this->dieUsage( 'Must be logged in to link accounts', 'notloggedin' );
+                       $this->dieWithError( 'apierror-mustbeloggedin-linkaccounts', 'notloggedin' );
                }
 
                $params = $this->extractRequestParams();
@@ -61,8 +60,8 @@ class ApiLinkAccount extends ApiBase {
                        $bits = wfParseUrl( $params['returnurl'] );
                        if ( !$bits || $bits['scheme'] === '' ) {
                                $encParamName = $this->encodeParamName( 'returnurl' );
-                               $this->dieUsage(
-                                       "Invalid value '{$params['returnurl']}' for url parameter $encParamName",
+                               $this->dieWithError(
+                                       [ 'apierror-badurl', $encParamName, wfEscapeWikiText( $params['returnurl'] ) ],
                                        "badurl_{$encParamName}"
                                );
                        }