r62504 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62503‎ | r62504 | r62505 >
Date:09:22, 15 February 2010
Author:raymond
Status:ok
Tags:
Comment:
Fix fir r62482: PHP Notice: Undefined index: token in /www/w/includes/api/ApiMain.php on line 415
Modified paths:
  • /trunk/phase3/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiMain.php
@@ -412,7 +412,7 @@
413413 $this->mModule = $module;
414414
415415 //Die if token required, but not provided (unless there is a gettoken parameter)
416 - if ( $module->requiresToken() && is_null( $params['token'] ) && !is_null( $params['gettoken'] ) )
 416+ if ( $module->requiresToken() && !isset( $params['token'] ) && isset( $params['gettoken'] ) )
417417 $this->dieUsageMsg( array( 'missingparam', 'token' ) );
418418
419419 if ( $module->shouldCheckMaxlag() && isset( $params['maxlag'] ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r62557Refactor requiresToken to getTokenSalt - Returns salt if exists, null if no s...reedy23:53, 15 February 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62482Start of "Bug 21991 - Move common query parameter (uc, rc) validation, token...reedy22:20, 14 February 2010

Status & tagging log