'autoblocked',
[ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) ]
) );
+ } elseif ( is_array( $error ) && $error[0] === 'systemblockedtext' && $user->getBlock() ) {
+ $status->fatal( ApiMessage::create(
+ 'apierror-systemblocked',
+ 'blocked',
+ [ 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) ]
+ ) );
} else {
call_user_func_array( [ $status, 'fatal' ], (array)$error );
}
*/
public function getFinalDescription() {
$desc = $this->getDescription();
- Hooks::run( 'APIGetDescription', [ &$this, &$desc ] );
+
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $apiModule = $this;
+ Hooks::run( 'APIGetDescription', [ &$apiModule, &$desc ] );
$desc = self::escapeWikiText( $desc );
if ( is_array( $desc ) ) {
$desc = implode( "\n", $desc );
] + ( isset( $params['token'] ) ? $params['token'] : [] );
}
- Hooks::run( 'APIGetAllowedParams', [ &$this, &$params, $flags ] );
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $apiModule = $this;
+ Hooks::run( 'APIGetAllowedParams', [ &$apiModule, &$params, $flags ] );
return $params;
}
$path = $this->getModulePath();
$desc = $this->getParamDescription();
- Hooks::run( 'APIGetParamDescription', [ &$this, &$desc ] );
+
+ // Avoid PHP 7.1 warning of passing $this by reference
+ $apiModule = $this;
+ Hooks::run( 'APIGetParamDescription', [ &$apiModule, &$desc ] );
if ( !$desc ) {
$desc = [];
* "apihelp-{$this->getModulePath()}-description".
*
* @deprecated since 1.25
- * @return Message|string|array
+ * @return Message|string|array|false
*/
protected function getDescription() {
return false;
'confirmedittext' => 'confirmedittext',
'blockedtext' => 'apierror-blocked',
'autoblockedtext' => 'apierror-autoblocked',
+ 'systemblockedtext' => 'apierror-systemblocked',
'actionthrottledtext' => 'apierror-ratelimited',
'alreadyrolled' => 'alreadyrolled',
'cantrollback' => 'cantrollback',