From: Alexandre Emsenhuber Date: Mon, 21 Jul 2008 16:24:39 +0000 (+0000) Subject: Use the internal diff engine if the diff excutable is not found X-Git-Tag: 1.31.0-rc.0~46431 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=e66e5e2416f6f3af9653c0ec585ce93787485812;p=lhc%2Fweb%2Fwiklou.git Use the internal diff engine if the diff excutable is not found --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 488e94edf3..f5a2660c7d 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1191,9 +1191,11 @@ function wfDiff( $before, $after, $params = '-u' ) { # This check may also protect against code injection in # case of broken installations. - if(! file_exists( $wgDiff ) ){ + if( !file_exists( $wgDiff ) ){ wfDebug( "diff executable not found\n" ); - return false; + $diffs = new Diff( explode( "\n", $before ), explode( "\n", $after ) ); + $format = new UnifiedDiffFormatter(); + return $format->format( $diffs ); } # Make temporary files