diff options
| author | Christoph M. Becker <cmb@php.net> | 2015-06-24 00:32:13 +0200 |
|---|---|---|
| committer | Christoph M. Becker <cmb@php.net> | 2015-06-24 00:32:13 +0200 |
| commit | 905c5f4858be48c1478debb07e91516aa916260f (patch) | |
| tree | d4bf47becf08f06bba73a113244c59c9d03a9d28 | |
| parent | 13347225ac5378276e87cb8d9bcecc4bd141067f (diff) | |
| parent | b03f743e7d6326537a711d9b0913e56da7c878c3 (diff) | |
| download | php-git-905c5f4858be48c1478debb07e91516aa916260f.tar.gz | |
Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
updated NEWS
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 |
