From 72e90545454c0e014318fa3c81658e035aac58c1 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 10 Jun 2009 13:00:47 +0200 Subject: applying patch to version 1.15.0 --- includes/api/ApiBlock.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'includes/api/ApiBlock.php') diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php index dfb11061..1c0bd5ac 100644 --- a/includes/api/ApiBlock.php +++ b/includes/api/ApiBlock.php @@ -50,7 +50,6 @@ class ApiBlock extends ApiBase { */ public function execute() { global $wgUser, $wgBlockAllowsUTEdit; - $this->getMain()->requestWriteMode(); $params = $this->extractRequestParams(); if($params['gettoken']) @@ -94,7 +93,7 @@ class ApiBlock extends ApiBase { $this->dieUsageMsg($retval); $res['user'] = $params['user']; - $res['userID'] = $userID; + $res['userID'] = intval($userID); $res['expiry'] = ($expiry == Block::infinity() ? 'infinite' : wfTimestamp(TS_ISO_8601, $expiry)); $res['reason'] = $params['reason']; if($params['anononly']) @@ -115,6 +114,10 @@ class ApiBlock extends ApiBase { public function mustBePosted() { return true; } + public function isWriteMode() { + return true; + } + public function getAllowedParams() { return array ( 'user' => null, @@ -163,6 +166,6 @@ class ApiBlock extends ApiBase { } public function getVersion() { - return __CLASS__ . ': $Id: ApiBlock.php 43677 2008-11-18 15:21:04Z catrope $'; + return __CLASS__ . ': $Id: ApiBlock.php 48091 2009-03-06 13:49:44Z catrope $'; } } -- cgit v1.2.3-54-g00ecf