Bug 35646 - ApiBlockTest::testMakeNormalBlock() broken
authorReedy <reedy@wikimedia.org>
Mon, 2 Apr 2012 18:11:50 +0000 (19:11 +0100)
committerReedy <reedy@wikimedia.org>
Mon, 2 Apr 2012 18:12:20 +0000 (19:12 +0100)
Change-Id: I964cde249ce7193cb1ba8c3430645c36067876fb

includes/api/ApiBlock.php
includes/api/ApiMain.php
includes/api/ApiUnblock.php

index 351ac6b..7d3a40b 100644 (file)
@@ -47,7 +47,7 @@ class ApiBlock extends ApiBase {
                $params = $this->extractRequestParams();
 
                if ( $params['gettoken'] ) {
-                       $res['blocktoken'] = $user->getEditToken( '', $this->getMain()->getRequest() );
+                       $res['blocktoken'] = $user->getEditToken();
                        $this->getResult()->addValue( null, $this->getModuleName(), $res );
                        return;
                }
index 15b0861..8f5cfca 100644 (file)
@@ -599,7 +599,7 @@ class ApiMain extends ApiBase {
                        if ( !isset( $moduleParams['token'] ) ) {
                                $this->dieUsageMsg( array( 'missingparam', 'token' ) );
                        } else {
-                               if ( !$this->getUser()->matchEditToken( $moduleParams['token'], $salt, $this->getRequest() ) ) {
+                               if ( !$this->getUser()->matchEditToken( $moduleParams['token'], $salt ) ) {
                                        $this->dieUsageMsg( 'sessionfailure' );
                                }
                        }
index db94fd5..e599e32 100644 (file)
@@ -44,7 +44,7 @@ class ApiUnblock extends ApiBase {
                $params = $this->extractRequestParams();
 
                if ( $params['gettoken'] ) {
-                       $res['unblocktoken'] = $user->getEditToken( '', $this->getMain()->getRequest() );
+                       $res['unblocktoken'] = $user->getEditToken();
                        $this->getResult()->addValue( null, $this->getModuleName(), $res );
                        return;
                }