Skip to content

Commit 905c5f4

Browse files
committed
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
2 parents 1334722 + b03f743 commit 905c5f4

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

ext/standard/exec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,10 @@ PHPAPI char *php_escape_shell_cmd(char *str)
281281
break;
282282
#else
283283
/* % is Windows specific for enviromental variables, ^%PATH% will
284-
output PATH whil ^%PATH^% not. escapeshellcmd will escape all %.
284+
output PATH while ^%PATH^% will not. escapeshellcmd will escape all % and !.
285285
*/
286286
case '%':
287+
case '!':
287288
case '"':
288289
case '\'':
289290
#endif
@@ -366,6 +367,7 @@ PHPAPI char *php_escape_shell_arg(char *str)
366367
#ifdef PHP_WIN32
367368
case '"':
368369
case '%':
370+
case '!':
369371
cmd[y++] = ' ';
370372
break;
371373
#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)