(bug 20353) wfShellExec() malfunctioning on NT builds 6002 and above. Patch by Jimmy Xu.
authorChad Horohoe <demon@users.mediawiki.org>
Mon, 21 Sep 2009 19:50:16 +0000 (19:50 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Mon, 21 Sep 2009 19:50:16 +0000 (19:50 +0000)
CREDITS
RELEASE-NOTES
includes/GlobalFunctions.php

diff --git a/CREDITS b/CREDITS
index 377a2a3..c859870 100644 (file)
--- 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
index c96dd68..f881ff8 100644 (file)
@@ -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 ==
 
index fa60b42..a69cab0 100644 (file)
@@ -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" );