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

ext/standard/exec.c

index db4f3f6a390b7417b060dbb69706e7a481cd6690..0f00df26650c062759e74e95b767213b44e5b102 100644 (file)
@@ -322,12 +322,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];