From: Chad Horohoe Date: Thu, 30 Sep 2010 15:35:10 +0000 (+0000) Subject: (bug 25367) wfShellExec() is more explicit when failing due to disabled passthru() X-Git-Tag: 1.31.0-rc.0~34725 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=b30df353879d0685d25655be21a27dce8d6fa8db;p=lhc%2Fweb%2Fwiklou.git (bug 25367) wfShellExec() is more explicit when failing due to disabled passthru() --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index e3ebd1ec39..2fbc279bf3 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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. diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 05521cb2a8..cc27ab2981 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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();