X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiMain.php;h=7f412bc1082bd11632d145630d56f2997109696c;hb=ec299eabb6e944b6a2b5db1c3530508d30d53046;hp=2105b811b9c307d0484f11706bb107d5ff050437;hpb=e59109e750a88c786683c661a3aea47055c6757b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 2105b811b9..7f412bc108 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -80,6 +80,7 @@ class ApiMain extends ApiBase { 'patrol' => 'ApiPatrol', 'import' => 'ApiImport', 'userrights' => 'ApiUserrights', + 'options' => 'ApiOptions', ); /** @@ -595,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 && isset( $moduleParams['gettoken'] ) && !$moduleParams['gettoken'] ) { + if ( $salt !== false && !$gettoken ) { if ( !isset( $moduleParams['token'] ) ) { $this->dieUsageMsg( array( 'missingparam', 'token' ) ); } else {