X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiMain.php;h=7f412bc1082bd11632d145630d56f2997109696c;hb=ec299eabb6e944b6a2b5db1c3530508d30d53046;hp=8f5cfcaf51d0232bb292181007f2542f16bc82d6;hpb=313298d9d77a2cb37f806466de897c4fa30e420a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 8f5cfcaf51..7f412bc108 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -61,6 +61,7 @@ class ApiMain extends ApiBase { 'paraminfo' => 'ApiParamInfo', 'rsd' => 'ApiRsd', 'compare' => 'ApiComparePages', + 'tokens' => 'ApiTokens', // Write modules 'purge' => 'ApiPurge', @@ -79,6 +80,7 @@ class ApiMain extends ApiBase { 'patrol' => 'ApiPatrol', 'import' => 'ApiImport', 'userrights' => 'ApiUserrights', + 'options' => 'ApiOptions', ); /** @@ -594,8 +596,14 @@ class ApiMain extends ApiBase { $moduleParams = $module->extractRequestParams(); // Die if token required, but not provided (unless there is a gettoken parameter) + if ( isset( $moduleParams['gettoken'] ) ) { + $gettoken = $moduleParams['gettoken']; + } else { + $gettoken = false; + } + $salt = $module->getTokenSalt(); - if ( $salt !== false && !$moduleParams['gettoken'] ) { + if ( $salt !== false && !$gettoken ) { if ( !isset( $moduleParams['token'] ) ) { $this->dieUsageMsg( array( 'missingparam', 'token' ) ); } else {