X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiCheckToken.php;h=3d2159cf50b36bf0c6cf60d7080c73c390ea7f3e;hb=5360a3497f31ce5af167746bf33375da5f32e061;hp=dfcbaf890e3f91e44420dadef88f07fe43de5b2e;hpb=5d97e895562ec09d9233e199c21f5af7c6d58c9f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiCheckToken.php b/includes/api/ApiCheckToken.php index dfcbaf890e..3d2159cf50 100644 --- a/includes/api/ApiCheckToken.php +++ b/includes/api/ApiCheckToken.php @@ -34,7 +34,7 @@ class ApiCheckToken extends ApiBase { $maxage = $params['maxtokenage']; $salts = ApiQueryTokens::getTokenTypeSalts(); - $res = array(); + $res = []; $tokenObj = ApiQueryTokens::getToken( $this->getUser(), $this->getRequest()->getSession(), $salts[$params['type']] @@ -58,25 +58,25 @@ class ApiCheckToken extends ApiBase { } public function getAllowedParams() { - return array( - 'type' => array( + return [ + 'type' => [ ApiBase::PARAM_TYPE => array_keys( ApiQueryTokens::getTokenTypeSalts() ), ApiBase::PARAM_REQUIRED => true, - ), - 'token' => array( + ], + 'token' => [ ApiBase::PARAM_TYPE => 'string', ApiBase::PARAM_REQUIRED => true, - ), - 'maxtokenage' => array( + ], + 'maxtokenage' => [ ApiBase::PARAM_TYPE => 'integer', - ), - ); + ], + ]; } protected function getExamplesMessages() { - return array( + return [ 'action=checktoken&type=csrf&token=123ABC' => 'apihelp-checktoken-example-simple', - ); + ]; } }