# This check may also protect against code injection in
# case of broken installations.
- if( !$wgDiff3 || !file_exists( $wgDiff3 ) ) {
+ wfSuppressWarnings();
+ $haveDiff3 = $wgDiff3 && file_exists( $wgDiff3 );
+ wfRestoreWarnings();
+
+ if( !$haveDiff3 ) {
wfDebug( "diff3 not found\n" );
return false;
}
}
global $wgDiff;
+ wfSuppressWarnings();
+ $haveDiff = $wgDiff && file_exists( $wgDiff );
+ wfRestoreWarnings();
# This check may also protect against code injection in
# case of broken installations.
- if( !file_exists( $wgDiff ) ) {
+ if( !$haveDiff ) {
wfDebug( "diff executable not found\n" );
$diffs = new Diff( explode( "\n", $before ), explode( "\n", $after ) );
$format = new UnifiedDiffFormatter();