From 72582d7f4cc857899b674a3f45232d8c8528e17c Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 19 Feb 2010 19:44:28 +0000 Subject: [PATCH] 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) --- includes/api/ApiMain.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1