http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72090

Revision: 72090
Author:   nikerabbit
Date:     2010-09-01 08:25:55 +0000 (Wed, 01 Sep 2010)

Log Message:
-----------
file_exists can emit warnings under safe mode... silence those for diff and 
diff3

Modified Paths:
--------------
    trunk/phase3/includes/GlobalFunctions.php

Modified: trunk/phase3/includes/GlobalFunctions.php
===================================================================
--- trunk/phase3/includes/GlobalFunctions.php   2010-09-01 08:03:18 UTC (rev 
72089)
+++ trunk/phase3/includes/GlobalFunctions.php   2010-09-01 08:25:55 UTC (rev 
72090)
@@ -1510,7 +1510,11 @@
 
        # 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;
        }
@@ -1580,10 +1584,13 @@
        }
 
        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();



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to