Bug 35671 - PHP Notice: Undefined index: gettoken in includes/api/ApiMain.php on...
authorReedy <reedy@wikimedia.org>
Tue, 3 Apr 2012 18:07:19 +0000 (19:07 +0100)
committerReedy <reedy@wikimedia.org>
Tue, 3 Apr 2012 18:07:33 +0000 (19:07 +0100)
Change-Id: I220dfcd964ceb4254b310140b916a7c63a3044ef

includes/api/ApiMain.php

index 8f5cfca..8fd8883 100644 (file)
@@ -595,7 +595,7 @@ class ApiMain extends ApiBase {
 
                // Die if token required, but not provided (unless there is a gettoken parameter)
                $salt = $module->getTokenSalt();
-               if ( $salt !== false && !$moduleParams['gettoken'] ) {
+               if ( $salt !== false && isset( $moduleParams['gettoken'] ) && !$moduleParams['gettoken'] ) {
                        if ( !isset( $moduleParams['token'] ) ) {
                                $this->dieUsageMsg( array( 'missingparam', 'token' ) );
                        } else {