pajoye Sun Aug 17 15:23:23 2008 UTC
Modified files:
/php-src/ext/standard exec.c
/php-src/ext/standard/tests/general_functions
escapeshellcmd-win32.phpt
Log:
- [DOC] improve fix for #43261 for % and "
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/exec.c?r1=1.135&r2=1.136&diff_format=u
Index: php-src/ext/standard/exec.c
diff -u php-src/ext/standard/exec.c:1.135 php-src/ext/standard/exec.c:1.136
--- php-src/ext/standard/exec.c:1.135 Tue Jul 22 21:56:25 2008
+++ php-src/ext/standard/exec.c Sun Aug 17 15:23:22 2008
@@ -16,7 +16,7 @@
| Ilia Alshanetsky <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.135 2008/07/22 21:56:25 scottmac Exp $ */
+/* $Id: exec.c,v 1.136 2008/08/17 15:23:22 pajoye Exp $ */
#include <stdio.h>
#include "php.h"
@@ -272,9 +272,9 @@
}
switch (str[x]) {
+#ifndef PHP_WIN32
case '"':
case '\'':
-#ifndef PHP_WIN32
if (!p && (p = memchr(str + x + 1, str[x], l -
x - 1))) {
/* noop */
} else if (p && *p == str[x]) {
@@ -285,7 +285,9 @@
cmd[y++] = str[x];
break;
#else
- /* This is Windows specific for enviromental variables
*/
+ /* % is Windows specific for enviromental variables,
^%PATH% will
+ output PATH whil ^%PATH^% not. escapeshellcmd
will escape all %.
+ */
case '%':
cmd[y++] = ' ';
break;
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt
diff -u
php-src/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt:1.1
php-src/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt:1.2
--- php-src/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt:1.1
Tue Jul 22 16:18:37 2008
+++ php-src/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt
Sun Aug 17 15:23:23 2008
@@ -16,7 +16,8 @@
'()[]{}$',
'%^',
'#&;`|*?',
- '~<>\\'
+ '~<>\\',
+ '%NOENV%'
);
$count = 1;
@@ -38,9 +39,11 @@
-- Test 4 --
string(14) "^(^)^[^]^{^}^$"
-- Test 5 --
-string(2) "^^"
+string(4) "^%^^"
-- Test 6 --
string(14) "^#^&^;^`^|^*^?"
-- Test 7 --
string(8) "^~^<^>^\"
+-- Test 8 --
+string(9) "^%NOENV^%"
Done