From: Sam Reed Date: Fri, 19 Feb 2010 19:44:28 +0000 (+0000) Subject: r65299 c5894 followup X-Git-Tag: 1.31.0-rc.0~37694 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=72582d7f4cc857899b674a3f45232d8c8528e17c;p=lhc%2Fweb%2Fwiklou.git r65299 c5894 followup Move isset check of gettoken upto level of $salt !== false. If gettoken is set, the module isn't going to do anything else (and therefore no point seeing if there is a token set, let alone attempting to validate it) --- diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 4d5e45562c..b450934a81 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -416,9 +416,9 @@ class ApiMain extends ApiBase { // Die if token required, but not provided (unless there is a gettoken parameter) $salt = $module->getTokenSalt(); - if ( $salt !== false ) + if ( $salt !== false && !isset( $moduleParams['gettoken'] ) ) { - if ( !isset( $moduleParams['token'] ) && !isset( $moduleParams['gettoken'] ) ) { + if ( !isset( $moduleParams['token'] ) ) { $this->dieUsageMsg( array( 'missingparam', 'token' ) ); } else { global $wgUser;