r27905 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r27904‎ | r27905 | r27906 >
Date:20:43, 27 November 2007
Author:amidaniel
Status:old
Tags:
Comment:
API: Another diff problem, var name mix-up.
Modified paths:
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -253,19 +253,21 @@
254254 $diff = new Diff($oldText, $newText);
255255 $r['from'] = $previousRevID;
256256 ApiResult::setContent($r, $wgContLang->unsegmentForDiff($this->formatter->format($diff)));
257 - $diffArr[$revid] = $r;
 257+ $this->diffArr[$revid] = $r;
258258
259259 $previousRevID = $revid;
260260 $oldText = $newText;
261261 }
262262
263 - # Populate the query result with the contents of $diffArr.
264 - $knownrevs = array_keys($diffArr);
265 - $i = count($knownrevs) - 1;
266 - foreach($data['query']['pages'][$pageID]['revisions'] as &$rev) {
267 - if ( $i >= 0 && isset ( $diffArr[$knownrevs[$i]] ) )
268 - $rev['difftoprev'] = $diffArr[$knownrevs[$i]];
269 - $i --;
 263+ if ( $this->diffArr ) {
 264+ # Populate the query result with the contents of $this->diffArr.
 265+ $knownrevs = array_keys($this->diffArr);
 266+ $i = count($knownrevs) - 1;
 267+ foreach($data['query']['pages'][$pageID]['revisions'] as &$rev) {
 268+ if ( $i >= 0 && isset ( $this->diffArr[$knownrevs[$i]] ) )
 269+ $rev['difftoprev'] = $this->diffArr[$knownrevs[$i]];
 270+ $i --;
 271+ }
270272 }
271273 }
272274

Status & tagging log