From b30df353879d0685d25655be21a27dce8d6fa8db Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 30 Sep 2010 15:35:10 +0000 Subject: [PATCH] (bug 25367) wfShellExec() is more explicit when failing due to disabled passthru() --- RELEASE-NOTES | 1 + includes/GlobalFunctions.php | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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(); -- 2.20.1