make wfShellExec() work on windows a bit better
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 6 Feb 2006 05:14:58 +0000 (05:14 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 6 Feb 2006 05:14:58 +0000 (05:14 +0000)
includes/GlobalFunctions.php

index a300252..7a46e5a 100644 (file)
@@ -1764,6 +1764,10 @@ function wfShellExec( $cmd )
                                $cmd = escapeshellarg( $script ) . " $time $memKB $cmd";
                        }
                }
+       } elseif ( php_uname( 's' ) == 'Windows NT' ) {
+               # This is a hack to work around PHP's flawed invocation of cmd.exe
+               # http://news.php.net/php.internals/21796
+               $cmd = '"' . $cmd . '"';
        }
        return shell_exec( $cmd );
 }