X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiMain.php;h=4220fb8d8062bb9897e0df74fd6fec9858cad853;hb=af614d2c3bebbf35e383e02bb957e41a295c159c;hp=fe6ed417cafa2624efdf1ed7d7b643d80afe86ab;hpb=02abae3248b9273be6b312aeb9f1cae81a3ac6c0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index fe6ed417ca..4220fb8d80 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -79,6 +79,7 @@ class ApiMain extends ApiBase { 'tokens' => 'ApiTokens', 'checktoken' => 'ApiCheckToken', 'cspreport' => 'ApiCSPReport', + 'validatepassword' => 'ApiValidatePassword', // Write modules 'purge' => 'ApiPurge', @@ -1046,7 +1047,9 @@ class ApiMain extends ApiBase { $params = [ 'apierror-exceptioncaught', WebRequest::getRequestId(), - wfEscapeWikiText( $e->getMessage() ) + $e instanceof ILocalizedException + ? $e->getMessageObject() + : wfEscapeWikiText( $e->getMessage() ) ]; } $messages[] = ApiMessage::create( $params, $code );