From: Chad Horohoe Date: Mon, 21 Sep 2009 19:50:16 +0000 (+0000) Subject: (bug 20353) wfShellExec() malfunctioning on NT builds 6002 and above. Patch by Jimmy Xu. X-Git-Tag: 1.31.0-rc.0~39589 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=b475a25f8d47a1b055f997370dd58d14fb55148d;p=lhc%2Fweb%2Fwiklou.git (bug 20353) wfShellExec() malfunctioning on NT builds 6002 and above. Patch by Jimmy Xu. --- diff --git a/CREDITS b/CREDITS index 377a2a3e6b..c8598701f8 100644 --- a/CREDITS +++ b/CREDITS @@ -74,6 +74,7 @@ following names for their contribution to the product. * Happy-melon * Jeremy Baron * Jidanni +* Jimmy Xu * Juliano F. Ravasi * Karun Dambiec * Lucas Garczewski diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c96dd68e9b..f881ff8c19 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -525,6 +525,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN returns false if the page doesn't exist * (bug 20751) ForeignApiRepo now urldecodes filenames when saving to local cache * (bug 20730) Fix to Special:Version ViewVC link for branch checkouts +* (bug 20353) wfShellExec() was adding extra quotes on Windows Vista, causing + command line scripts to fail == API changes in 1.16 == diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index fa60b421de..a69cab0890 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2326,10 +2326,10 @@ function wfShellExec( $cmd, &$retval=null ) { $cmd = escapeshellarg( $script ) . " $time $mem $filesize " . escapeshellarg( $cmd ); } } - } elseif ( php_uname( 's' ) == 'Windows NT' ) { + } elseif ( php_uname( 's' ) == 'Windows NT' && substr( php_uname( 'v' ), 6, 4 ) <= 6001 ) { # This is a hack to work around PHP's flawed invocation of cmd.exe # http://news.php.net/php.internals/21796 - $cmd = '"' . $cmd . '"'; // FIXME: breaking Vista sp2/PHP 5.2.9(2) + $cmd = '"' . $cmd . '"'; } wfDebug( "wfShellExec: $cmd\n" );