summaryrefslogtreecommitdiff
path: root/includes/api/ApiBlock.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiBlock.php')
-rw-r--r--includes/api/ApiBlock.php9
1 files changed, 6 insertions, 3 deletions
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 $';
}
}