}
function getDiff( $otext, $ntext, $otitle, $ntitle ) {
- global $wgUseExternalDiffEngine;
+ global $wgUseExternalDiffEngine, $wgContLang;
$out = "
<table border='0' width='98%' cellpadding='0' cellspacing='4' class='diff'>
<tr>
<td colspan='2' width='50%' align='center' class='diff-ntitle'>{$ntitle}</td>
</tr>
";
-
+ $otext = $wgContLang->segmentForDiff($otext);
+ $ntext = $wgContLang->segmentForDiff($ntext);
+ $difftext='';
if ( $wgUseExternalDiffEngine ) {
# For historical reasons, external diff engine expects
# input text to be HTML-escaped already
if( !function_exists( 'wikidiff_do_diff' ) ) {
dl('php_wikidiff.so');
}
- $out .= wikidiff_do_diff( $otext, $ntext, 2 );
+ $difftext = wikidiff_do_diff( $otext, $ntext, 2 );
} else {
$ota = explode( "\n", str_replace( "\r\n", "\n", $otext ) );
$nta = explode( "\n", str_replace( "\r\n", "\n", $ntext ) );
$diffs =& new Diff( $ota, $nta );
$formatter =& new TableDiffFormatter();
- $out .= $formatter->format( $diffs );
+ $difftext = $formatter->format( $diffs );
}
- $out .= "</table>\n";
+ $difftext = $wgContLang->unsegmentForDiff($difftext);
+ $out .= $difftext."</table>\n";
return $out;
}
$numer = $xlim - $xoff + $nchunks - 1;
$x = $xoff;
for ($chunk = 0; $chunk < $nchunks; $chunk++) {
+ wfProfileIn( "$fname-chunk" );
if ($chunk > 0)
for ($i = 0; $i <= $this->lcs; $i++)
$ymids[$i][$chunk-1] = $this->seq[$i];
}
}
}
+ wfProfileOut( "$fname-chunk" );
}
$seps[] = $flip ? array($yoff, $xoff) : array($xoff, $yoff);