From: Scott MacVicar Date: Fri, 30 May 2008 16:52:06 +0000 (+0000) Subject: Fixed bug #43261 X-Git-Tag: BEFORE_HEAD_NS_CHANGE~1626 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba1e3103b3eedb8b3b766e4a3576f0f33fc0f75d;p=php Fixed bug #43261 (Use ^ as an escape character for Windows escapeshellcmd) --- diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 4bb59bde38..f085fc68aa 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -307,12 +307,12 @@ PHPAPI char *php_escape_shell_cmd(char *str) case '\x0A': /* excluding these two */ case '\xFF': #ifdef PHP_WIN32 - /* since Windows does not allow us to escape these chars, just remove them */ + /* This is Windows specific for enviromental variables */ case '%': - cmd[y++] = ' '; - break; -#endif + cmd[y++] = '^'; +#else cmd[y++] = '\\'; +#endif /* fall-through */ default: cmd[y++] = str[x];