<?php
/**
- * Copyright © 2016 Brad Jorsch <bjorsch@wikimedia.org>
+ * Copyright © 2016 Wikimedia Foundation and contributors
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
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();
$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}"
);
}
}
public function getHelpUrls() {
- return 'https://www.mediawiki.org/wiki/API:Linkaccount';
+ return 'https://www.mediawiki.org/wiki/Special:MyLanguage/API:Linkaccount';
}
}