pajoye Sun Aug 17 15:23:45 2008 UTC
Modified files: (Branch: PHP_5_3)
/php-src/ext/standard exec.c
/php-src/ext/standard/tests/general_functions
escapeshellcmd-win32.phpt
Log:
- [DOC] MFH: improve fix for #43261 for % and "
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/exec.c?r1=1.113.2.3.2.1.2.11&r2=1.113.2.3.2.1.2.12&diff_format=u
Index: php-src/ext/standard/exec.c
diff -u php-src/ext/standard/exec.c:1.113.2.3.2.1.2.11
php-src/ext/standard/exec.c:1.113.2.3.2.1.2.12
--- php-src/ext/standard/exec.c:1.113.2.3.2.1.2.11 Tue Jul 22 21:53:53 2008
+++ php-src/ext/standard/exec.c Sun Aug 17 15:23:45 2008
@@ -16,7 +16,7 @@
| Ilia Alshanetsky <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.113.2.3.2.1.2.11 2008/07/22 21:53:53 scottmac Exp $ */
+/* $Id: exec.c,v 1.113.2.3.2.1.2.12 2008/08/17 15:23:45 pajoye Exp $ */
#include <stdio.h>
#include "php.h"
@@ -287,9 +287,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]) {
@@ -300,10 +300,12 @@
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;
+ case '"':
+ case '\'':
#endif
case '#': /* This is character-set independent */
case '&':
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt?r1=1.1.2.2&r2=1.1.2.3&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.2.2
php-src/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt:1.1.2.3
---
php-src/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt:1.1.2.2
Tue Jul 22 16:21:16 2008
+++ php-src/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt
Sun Aug 17 15:23:45 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