# This check may also protect against code injection in
# case of broken installations.
if(! file_exists( $wgDiff3 ) ){
+ wfDebug( "diff3 not found\n" );
return false;
}
fwrite( $yourtextFile, $yours ); fclose( $yourtextFile );
# Check for a conflict
- $cmd = wfEscapeShellArg( $wgDiff3 ) . ' -a --overlap-only ' .
+ $cmd = $wgDiff3 . ' -a --overlap-only ' .
wfEscapeShellArg( $mytextName ) . ' ' .
wfEscapeShellArg( $oldtextName ) . ' ' .
wfEscapeShellArg( $yourtextName );
pclose( $handle );
# Merge differences
- $cmd = wfEscapeShellArg( $wgDiff3 ) . ' -a -e --merge ' .
+ $cmd = $wgDiff3 . ' -a -e --merge ' .
wfEscapeShellArg( $mytextName, $oldtextName, $yourtextName );
$handle = popen( $cmd, 'r' );
$result = '';
} while ( true );
pclose( $handle );
unlink( $mytextName ); unlink( $oldtextName ); unlink( $yourtextName );
+
+ if ( $result === '' && $old !== '' && $conflict == false ) {
+ wfDebug( "Unexpected null result from diff3.\nCommand: $cmd\nOutput: " . `$cmd 2>&1` . "\n" );
+ $conflict = true;
+ }
return ! $conflict;
}