diff options
author | Christoph M. Becker <cmb@php.net> | 2015-06-24 00:23:39 +0200 |
---|---|---|
committer | Christoph M. Becker <cmb@php.net> | 2015-06-24 00:23:39 +0200 |
commit | 8da8dc04b6c6087e225eea29d0785d57e1541481 (patch) | |
tree | 0365f48f0f5d72975183587b3d177e94f627b3e3 | |
parent | 1cbcbcbc219908e32d96d4d1fefbbb9a0ee7a3cf (diff) | |
parent | 921544cad96de235c451b5174d0669e02c76258b (diff) | |
download | php-git-8da8dc04b6c6087e225eea29d0785d57e1541481.tar.gz |
Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
updated NEWS
Fixed bug #69768 (escapeshell*() doesn't cater to !)
bump API version to 6.8
-rw-r--r-- | ext/standard/exec.c | 4 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt | 2 | ||||
-rw-r--r-- | ext/standard/tests/general_functions/escapeshellcmd-win32.phpt | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 06c068399d..66d4537dab 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -281,9 +281,10 @@ PHPAPI char *php_escape_shell_cmd(char *str) break; #else /* % is Windows specific for enviromental variables, ^%PATH% will - output PATH whil ^%PATH^% not. escapeshellcmd will escape all %. + output PATH while ^%PATH^% will not. escapeshellcmd will escape all % and !. */ case '%': + case '!': case '"': case '\'': #endif @@ -366,6 +367,7 @@ PHPAPI char *php_escape_shell_arg(char *str) #ifdef PHP_WIN32 case '"': case '%': + case '!': cmd[y++] = ' '; break; #else diff --git a/ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt b/ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt index 888005633d..d97c1a956b 100644 --- a/ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt +++ b/ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt @@ -18,6 +18,7 @@ echo "Simple testcase for escapeshellarg() function\n"; var_dump(escapeshellarg("Mr O'Neil")); var_dump(escapeshellarg("Mr O\'Neil")); var_dump(escapeshellarg("%FILENAME")); +var_dump(escapeshellarg("!FILENAME")); var_dump(escapeshellarg("")); echo "Done\n"; @@ -27,5 +28,6 @@ Simple testcase for escapeshellarg() function string(11) ""Mr O'Neil"" string(12) ""Mr O\'Neil"" string(11) "" FILENAME"" +string(11) "" FILENAME"" string(2) """" Done
\ No newline at end of file diff --git a/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt b/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt index 9fcb99188c..7d2a029b47 100644 --- a/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt +++ b/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt @@ -17,7 +17,8 @@ $data = array( '%^', '#&;`|*?', '~<>\\', - '%NOENV%' + '%NOENV%', + '!NOENV!' ); $count = 1; @@ -46,4 +47,6 @@ string(14) "^#^&^;^`^|^*^?" string(8) "^~^<^>^\" -- Test 8 -- string(9) "^%NOENV^%" +-- Test 9 -- +string(9) "^!NOENV^!" Done |