Don't use wfDiff() in AbuseFilter

Bug: T158850
Change-Id: Ib5bd4eacc3dd26dc2abdf4eedce66ed228b326d8
This commit is contained in:
Huji Lee 2017-02-24 09:22:56 -05:00 committed by Huji
parent 26a72986a2
commit 630ef7f2ce

View file

@ -153,9 +153,11 @@ class AFComputedVariable {
case 'diff':
$text1Var = $parameters['oldtext-var'];
$text2Var = $parameters['newtext-var'];
$text1 = $vars->getVar( $text1Var )->toString() . "\n";
$text2 = $vars->getVar( $text2Var )->toString() . "\n";
$result = wfDiff( $text1, $text2 );
$text1 = $vars->getVar( $text1Var )->toString();
$text2 = $vars->getVar( $text2Var )->toString();
$diffs = new Diff( explode( "\n", $text1 ), explode( "\n", $text2 ) );
$format = new UnifiedDiffFormatter();
$result = $format->format( $diffs );
break;
case 'diff-split':
$diff = $vars->getVar( $parameters['diff-var'] )->toString();