r48124 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48123‎ | r48124 | r48125 >
Date:13:05, 7 March 2009
Author:catrope
Status:deferred
Tags:
Comment:
Backporting r48122 to 1.13 branch
Modified paths:
  • /branches/REL1_13/phase3/includes/api/ApiDelete.php (modified) (history)
  • /branches/REL1_13/phase3/includes/api/ApiProtect.php (modified) (history)
  • /branches/REL1_13/phase3/includes/api/ApiRollback.php (modified) (history)

Diff [purge]

Index: branches/REL1_13/phase3/includes/api/ApiProtect.php
@@ -59,7 +59,7 @@
6060 $errors = $titleObj->getUserPermissionsErrors('protect', $wgUser);
6161 if(!empty($errors))
6262 // We don't care about multiple errors, just report one of them
63 - $this->dieUsageMsg(current($errors));
 63+ $this->dieUsageMsg(reset($errors));
6464
6565 if(in_array($params['expiry'], array('infinite', 'indefinite', 'never')))
6666 $expiry = Block::infinity();
Index: branches/REL1_13/phase3/includes/api/ApiRollback.php
@@ -66,7 +66,7 @@
6767
6868 if(!empty($retval))
6969 // We don't care about multiple errors, just report one of them
70 - $this->dieUsageMsg(current($retval));
 70+ $this->dieUsageMsg(reset($retval));
7171
7272 $current = $target = $summary = NULL;
7373 extract($details);
Index: branches/REL1_13/phase3/includes/api/ApiDelete.php
@@ -69,14 +69,14 @@
7070 $retval = self::deletefile($params['token'], $titleObj, $params['oldimage'], $reason, false);
7171 if(!empty($retval))
7272 // We don't care about multiple errors, just report one of them
73 - $this->dieUsageMsg(current($retval));
 73+ $this->dieUsageMsg(reset($retval));
7474 } else {
7575 $articleObj = new Article($titleObj);
7676 $retval = self::delete($articleObj, $params['token'], $reason);
7777
7878 if(!empty($retval))
7979 // We don't care about multiple errors, just report one of them
80 - $this->dieUsageMsg(current($retval));
 80+ $this->dieUsageMsg(reset($retval));
8181
8282 if($params['watch'] || $wgUser->getOption('watchdeletion'))
8383 $articleObj->doWatch();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r48122* API: (bug 17832) action=delete returns 'unknownerror' instead of 'permissio...catrope12:58, 7 March 2009

Status & tagging log