Skip to content

Commit 00adcbd

Browse files
committed
Merge branch 'PHP-5.6'
* PHP-5.6: updated NEWS Fixed bug #69768 (escapeshell*() doesn't cater to !) bump API version to 6.8
2 parents e08d27d + e181931 commit 00adcbd

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

ext/standard/exec.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,11 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
282282
cmd->val[y++] = str[x];
283283
break;
284284
#else
285-
/* % is Windows specific for environmental variables, ^%PATH% will
286-
output PATH whil ^%PATH^% not. escapeshellcmd->val will escape all %.
285+
/* % is Windows specific for environmental variables, ^%PATH% will
286+
output PATH while ^%PATH^% will not. escapeshellcmd->val will escape all % and !.
287287
*/
288288
case '%':
289+
case '!':
289290
case '"':
290291
case '\'':
291292
#endif
@@ -369,6 +370,7 @@ PHPAPI zend_string *php_escape_shell_arg(char *str)
369370
#ifdef PHP_WIN32
370371
case '"':
371372
case '%':
373+
case '!':
372374
cmd->val[y++] = ' ';
373375
break;
374376
#else

ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ echo "Simple testcase for escapeshellarg() function\n";
1818
var_dump(escapeshellarg("Mr O'Neil"));
1919
var_dump(escapeshellarg("Mr O\'Neil"));
2020
var_dump(escapeshellarg("%FILENAME"));
21+
var_dump(escapeshellarg("!FILENAME"));
2122
var_dump(escapeshellarg(""));
2223

2324
echo "Done\n";
@@ -27,5 +28,6 @@ Simple testcase for escapeshellarg() function
2728
string(11) ""Mr O'Neil""
2829
string(12) ""Mr O\'Neil""
2930
string(11) "" FILENAME""
31+
string(11) "" FILENAME""
3032
string(2) """"
3133
Done

ext/standard/tests/general_functions/escapeshellcmd-win32.phpt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ $data = array(
1717
'%^',
1818
'#&;`|*?',
1919
'~<>\\',
20-
'%NOENV%'
20+
'%NOENV%',
21+
'!NOENV!'
2122
);
2223

2324
$count = 1;
@@ -46,4 +47,6 @@ string(14) "^#^&^;^`^|^*^?"
4647
string(8) "^~^<^>^\"
4748
-- Test 8 --
4849
string(9) "^%NOENV^%"
50+
-- Test 9 --
51+
string(9) "^!NOENV^!"
4952
Done

0 commit comments

Comments
 (0)