iliaa Tue May 18 09:43:33 2004 EDT
Modified files: (Branch: PHP_4_3)
/php-src NEWS
/php-src/ext/standard exec.c
Log:
MFH: Fixed command line escaping routines for win32.
http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1247.2.662&r2=1.1247.2.663&ty=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.1247.2.662 php-src/NEWS:1.1247.2.663
--- php-src/NEWS:1.1247.2.662 Sun May 16 17:20:29 2004
+++ php-src/NEWS Tue May 18 09:43:33 2004
@@ -2,6 +2,7 @@
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2004, Version 4.3.7
- Upgraded bundled GD library to 2.0.23. (Ilia)
+- Fixed command line escaping routines for win32. (Ilia)
- Fixed problems with *printf() functions and '%f' formatting. (Marcus)
- Fixed possible crash inside pg_copy_(to|from) function if delimiter is more
then 1 character long. (Ilia)
http://cvs.php.net/diff.php/php-src/ext/standard/exec.c?r1=1.84.2.13&r2=1.84.2.14&ty=u
Index: php-src/ext/standard/exec.c
diff -u php-src/ext/standard/exec.c:1.84.2.13 php-src/ext/standard/exec.c:1.84.2.14
--- php-src/ext/standard/exec.c:1.84.2.13 Wed Nov 19 10:34:36 2003
+++ php-src/ext/standard/exec.c Tue May 18 09:43:33 2004
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.84.2.13 2003/11/19 15:34:36 iliaa Exp $ */
+/* $Id: exec.c,v 1.84.2.14 2004/05/18 13:43:33 iliaa Exp $ */
#include <stdio.h>
#include "php.h"
@@ -410,6 +410,7 @@
switch (str[x]) {
case '"':
case '\'':
+#ifndef PHP_WIN32
if (!p && (p = memchr(str + x + 1, str[x], l - x -
1))) {
/* noop */
} else if (p && *p == str[x]) {
@@ -419,6 +420,7 @@
}
cmd[y++] = str[x];
break;
+#endif
case '#': /* This is character-set independent */
case '&':
case ';':
@@ -440,6 +442,12 @@
case '\\':
case '\x0A': /* excluding these two */
case '\xFF':
+#ifdef PHP_WIN32
+ /* since Windows does not allow us to escape these chars, just
remove them */
+ case '%':
+ cmd[y++] = ' ';
+ break;
+#endif
cmd[y++] = '\\';
/* fall-through */
default:
@@ -472,7 +480,9 @@
switch (str[x]) {
#ifdef PHP_WIN32
case '"':
- cmd[y++] = '\\';
+ case '%':
+ cmd[y++] = ' ';
+ break;
#else
case '\'':
cmd[y++] = '\'';
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php