]> granicus.if.org Git - php/commitdiff
Fixed bug #43261
authorScott MacVicar <scottmac@php.net>
Fri, 30 May 2008 16:52:06 +0000 (16:52 +0000)
committerScott MacVicar <scottmac@php.net>
Fri, 30 May 2008 16:52:06 +0000 (16:52 +0000)
(Use ^ as an escape character for Windows escapeshellcmd)

ext/standard/exec.c

index 4bb59bde3879e5178f4516f9fa70f4cfa9ad3066..f085fc68aa52186f074674c3bef5cc6cd7af4f58 100644 (file)
@@ -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];