iliaa Wed Nov 19 10:34:31 2003 EDT
Modified files:
/php-src/ext/standard exec.c
Log:
Fixed bug #26285 (escapeshellarg() uses wrong quotes on windows).
Index: php-src/ext/standard/exec.c
diff -u php-src/ext/standard/exec.c:1.105 php-src/ext/standard/exec.c:1.106
--- php-src/ext/standard/exec.c:1.105 Fri Sep 26 04:09:55 2003
+++ php-src/ext/standard/exec.c Wed Nov 19 10:34:30 2003
@@ -16,7 +16,7 @@
| Ilia Alshanetsky <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.105 2003/09/26 08:09:55 hholzgra Exp $ */
+/* $Id: exec.c,v 1.106 2003/11/19 15:34:30 iliaa Exp $ */
#include <stdio.h>
#include "php.h"
@@ -322,20 +322,33 @@
cmd = safe_emalloc(4, l, 3); /* worst case */
+#ifdef PHP_WIN32
+ cmd[y++] = '"';
+#else
cmd[y++] = '\'';
-
+#endif
+
for (x = 0; x < l; x++) {
switch (str[x]) {
+#ifdef PHP_WIN32
+ case '"':
+ cmd[y++] = '\\';
+#else
case '\'':
cmd[y++] = '\'';
cmd[y++] = '\\';
cmd[y++] = '\'';
+#endif
/* fall-through */
default:
cmd[y++] = str[x];
}
}
+#ifdef PHP_WIN32
+ cmd[y++] = '"';
+#else
cmd[y++] = '\'';
+#endif
cmd[y] = '\0';
return cmd;
}
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php