X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiTokens.php;h=fc2951a9db8bfaad7693bca5df6f84c464f999f3;hb=a4943f548be4cfc8f286f00fc8064ff0e377f2ba;hp=63bae9d42b41f98a0d665e6de7011cdc0c751e6b;hpb=40a628a501fc05bb00e834fe359ca4061925f320;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiTokens.php b/includes/api/ApiTokens.php index 63bae9d42b..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; }