X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiTokens.php;h=fc2951a9db8bfaad7693bca5df6f84c464f999f3;hb=a4943f548be4cfc8f286f00fc8064ff0e377f2ba;hp=4940394fe824368f71e3d8390d969af880354c8f;hpb=7f91193ef37d534949950c980416b5a921cd5d79;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiTokens.php b/includes/api/ApiTokens.php index 4940394fe8..fc2951a9db 100644 --- a/includes/api/ApiTokens.php +++ b/includes/api/ApiTokens.php @@ -31,10 +31,10 @@ class ApiTokens extends ApiBase { public function execute() { - $this->setWarning( - 'action=tokens has been deprecated. Please use action=query&meta=tokens instead.' + $this->addDeprecation( + [ 'apiwarn-deprecation-withreplacement', 'action=tokens', 'action=query&meta=tokens' ], + 'action=tokens' ); - $this->logFeatureUsage( 'action=tokens' ); $params = $this->extractRequestParams(); $res = [ @@ -46,7 +46,7 @@ class ApiTokens extends ApiBase { $val = call_user_func( $types[$type], null, null ); if ( $val === false ) { - $this->setWarning( "Action '$type' is not allowed for the current user" ); + $this->addWarning( [ 'apiwarn-tokennotallowed', $type ] ); } else { $res[$type . 'token'] = $val; }