r28006 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r28005‎ | r28006 | r28007 >
Date:09:08, 1 December 2007
Author:vasilievvv
Status:old
Tags:
Comment:
* Fix rvdiffformat=array
* Fix notice about undefined index in ArrayDiffFormatter
Modified paths:
  • /trunk/phase3/includes/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryRevisions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryRevisions.php
@@ -346,7 +346,14 @@
347347 $newText = explode("\n", $wgContLang->segmentForDiff($text));
348348 $diff = new Diff($this->diffOldText, $newText);
349349 $vals['diffto']['from'] = $this->diffto;
350 - ApiResult::setContent($vals['diffto'], $wgContLang->unsegmentForDiff($this->formatter->format($diff)));
 350+ $arraydiff = $this->formatter instanceof ArrayDiffFormatter;
 351+ if( $arraydiff ) {
 352+ $changes = $wgContLang->unsegmentForDiff($this->formatter->format($diff));
 353+ $this->getResult()->setIndexedTagName( $changes, 'change' );
 354+ $vals['diffto'] = $changes;
 355+ } else {
 356+ ApiResult::setContent($vals['diffto'], $wgContLang->unsegmentForDiff($this->formatter->format($diff)));
 357+ }
351358 }
352359 if($this->difftoprev)
353360 // Cache the revision's content for later use
Index: trunk/phase3/includes/DifferenceEngine.php
@@ -1742,7 +1742,7 @@
17431743 $retval[] = array(
17441744 'action' => 'change',
17451745 'old' => $l,
1746 - 'new' => $edit->closing[$i],
 1746+ 'new' => @$edit->closing[$i],
17471747 'oldline' => $oldline++,
17481748 'newline' => $newline++,
17491749 );

Status & tagging log