Use the internal diff engine if the diff excutable is not found
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 21 Jul 2008 16:24:39 +0000 (16:24 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 21 Jul 2008 16:24:39 +0000 (16:24 +0000)
includes/GlobalFunctions.php

index 488e94e..f5a2660 100644 (file)
@@ -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