File tree Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Expand file tree Collapse file tree 3 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -281,9 +281,10 @@ PHPAPI char *php_escape_shell_cmd(char *str)
281
281
break ;
282
282
#else
283
283
/* % 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 ! .
285
285
*/
286
286
case '%' :
287
+ case '!' :
287
288
case '"' :
288
289
case '\'' :
289
290
#endif
@@ -366,6 +367,7 @@ PHPAPI char *php_escape_shell_arg(char *str)
366
367
#ifdef PHP_WIN32
367
368
case '"' :
368
369
case '%' :
370
+ case '!' :
369
371
cmd [y ++ ] = ' ' ;
370
372
break ;
371
373
#else
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ echo "Simple testcase for escapeshellarg() function\n";
18
18
var_dump (escapeshellarg ("Mr O'Neil " ));
19
19
var_dump (escapeshellarg ("Mr O\'Neil " ));
20
20
var_dump (escapeshellarg ("%FILENAME " ));
21
+ var_dump (escapeshellarg ("!FILENAME " ));
21
22
var_dump (escapeshellarg ("" ));
22
23
23
24
echo "Done \n" ;
@@ -27,5 +28,6 @@ Simple testcase for escapeshellarg() function
27
28
string(11) ""Mr O'Neil""
28
29
string(12) ""Mr O\'Neil""
29
30
string(11) "" FILENAME""
31
+ string(11) "" FILENAME""
30
32
string(2) """"
31
33
Done
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ $data = array(
17
17
'%^ ' ,
18
18
'#&;`|*? ' ,
19
19
'~<> \\' ,
20
- '%NOENV% '
20
+ '%NOENV% ' ,
21
+ '!NOENV! '
21
22
);
22
23
23
24
$ count = 1 ;
@@ -46,4 +47,6 @@ string(14) "^#^&^;^`^|^*^?"
46
47
string(8) "^~^<^>^\"
47
48
-- Test 8 --
48
49
string(9) "^%NOENV^%"
50
+ -- Test 9 --
51
+ string(9) "^!NOENV^!"
49
52
Done
You can’t perform that action at this time.
0 commit comments