r48128 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48127‎ | r48128 | r48129 >
Date:13:15, 7 March 2009
Author:catrope
Status:deferred
Tags:
Comment:
Backport r48122 and r48125 to 1.12 branch and kill another current() that was removed in 1.13
Modified paths:
  • /branches/REL1_12/phase3/includes/api/ApiDelete.php (modified) (history)
  • /branches/REL1_12/phase3/includes/api/ApiMove.php (modified) (history)
  • /branches/REL1_12/phase3/includes/api/ApiQueryBacklinks.php (modified) (history)
  • /branches/REL1_12/phase3/includes/api/ApiQueryRevisions.php (modified) (history)
  • /branches/REL1_12/phase3/includes/api/ApiRollback.php (modified) (history)

Diff [purge]

Index: branches/REL1_12/phase3/includes/api/ApiMove.php
@@ -77,7 +77,7 @@
7878 $toTitle->getUserPermissionsErrors('edit', $wgUser));
7979 if(!empty($errors))
8080 // We don't care about multiple errors, just report one of them
81 - $this->dieUsageMsg(current($errors));
 81+ $this->dieUsageMsg(reset($errors));
8282
8383 $dbw = wfGetDB(DB_MASTER);
8484 $dbw->begin();
Index: branches/REL1_12/phase3/includes/api/ApiQueryBacklinks.php
@@ -211,7 +211,7 @@
212212 } else { // This case is obsolete. Will support this for a while
213213 if ($count !== 1)
214214 $this->dieUsage("The {$this->getModuleName()} query requires one title to start", 'bad_title_count');
215 - $this->rootTitle = current($pageSet->getTitles()); // only one title there
 215+ $this->rootTitle = reset($pageSet->getTitles()); // only one title there
216216 $this->setWarning('Using titles parameter is obsolete for this list. Use ' . $this->encodeParamName('title') . ' instead.');
217217 }
218218 }
Index: branches/REL1_12/phase3/includes/api/ApiRollback.php
@@ -68,7 +68,7 @@
6969
7070 if(!empty($retval))
7171 // We don't care about multiple errors, just report one of them
72 - $this->dieUsageMsg(current($retval));
 72+ $this->dieUsageMsg(reset($retval));
7373
7474 $dbw->commit();
7575 $current = $target = $summary = NULL;
Index: branches/REL1_12/phase3/includes/api/ApiDelete.php
@@ -72,7 +72,7 @@
7373
7474 if(!empty($retval))
7575 // We don't care about multiple errors, just report one of them
76 - $this->dieUsageMsg(current($retval));
 76+ $this->dieUsageMsg(reset($retval));
7777
7878 $dbw->commit();
7979 $r = array('title' => $titleObj->getPrefixedText(), 'reason' => $reason);
Index: branches/REL1_12/phase3/includes/api/ApiQueryRevisions.php
@@ -157,7 +157,7 @@
158158 $this->validateLimit('limit', $limit, 1, $userMax, $botMax);
159159
160160 // There is only one ID, use it
161 - $this->addWhereFld('rev_page', current(array_keys($pageSet->getGoodTitles())));
 161+ $this->addWhereFld('rev_page', reset(array_keys($pageSet->getGoodTitles())));
162162
163163 if(!is_null($user)) {
164164 $this->addWhereFld('rev_user_text', $user);

Past revisions this follows-up on

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

Status & tagging log