(bug 25367) wfShellExec() is more explicit when failing due to disabled passthru()
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 30 Sep 2010 15:35:10 +0000 (15:35 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 30 Sep 2010 15:35:10 +0000 (15:35 +0000)
RELEASE-NOTES
includes/GlobalFunctions.php

index e3ebd1e..2fbc279 100644 (file)
@@ -341,6 +341,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 25292) SkinSubPageSubtitle hook now passes the Skin object as second
   parameter
 * (bug 25167) Correctly load JS fixes for IE6 (fixing a regression in 1.16)
+* (bug 25367) wfShellExec() is more explicit when failing due to disabled passthru()
 
 === API changes in 1.17 ===
 * (bug 22738) Allow filtering by action type on query=logevent.
index 05521cb..cc27ab2 100644 (file)
@@ -2449,19 +2449,21 @@ function wfShellExec( $cmd, &$retval = null ) {
                $disabled = false;
                if( wfIniGetBool( 'safe_mode' ) ) {
                        wfDebug( "wfShellExec can't run in safe_mode, PHP's exec functions are too broken.\n" );
-                       $disabled = true;
+                       $disabled = 'safemode';
                }
                $functions = explode( ',', ini_get( 'disable_functions' ) );
                $functions = array_map( 'trim', $functions );
                $functions = array_map( 'strtolower', $functions );
                if ( in_array( 'passthru', $functions ) ) {
                        wfDebug( "passthru is in disabled_functions\n" );
-                       $disabled = true;
+                       $disabled = 'passthru';
                }
        }
        if ( $disabled ) {
                $retval = 1;
-               return 'Unable to run external programs in safe mode.';
+               return $disabled == 'safemode' ?
+                       'Unable to run external programs in safe mode.' :
+                       'Unable to run external programs, passthru() is disabled.';
        }
 
        wfInitShellLocale();