File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -282,10 +282,11 @@ PHPAPI zend_string *php_escape_shell_cmd(char *str)
282
282
cmd -> val [y ++ ] = str [x ];
283
283
break ;
284
284
#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 ! .
287
287
*/
288
288
case '%' :
289
+ case '!' :
289
290
case '"' :
290
291
case '\'' :
291
292
#endif
@@ -369,6 +370,7 @@ PHPAPI zend_string *php_escape_shell_arg(char *str)
369
370
#ifdef PHP_WIN32
370
371
case '"' :
371
372
case '%' :
373
+ case '!' :
372
374
cmd -> val [y ++ ] = ' ' ;
373
375
break ;
374
376
#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