Skip to content

Commit

Permalink
Merge branch 'PHP-5.5' into PHP-5.6
Browse files Browse the repository at this point in the history
* PHP-5.5:
  updated NEWS
  updated NEWS
  Fixed bug #69768 (escapeshell*() doesn't cater to !)
  bump API version to 6.8
  • Loading branch information
cmb69 committed Jun 23, 2015
2 parents 1334722 + b03f743 commit 905c5f4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
4 changes: 3 additions & 1 deletion ext/standard/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -366,6 +367,7 @@ PHPAPI char *php_escape_shell_arg(char *str)
#ifdef PHP_WIN32
case '"':
case '%':
case '!':
cmd[y++] = ' ';
break;
#else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ $data = array(
'%^',
'#&;`|*?',
'~<>\\',
'%NOENV%'
'%NOENV%',
'!NOENV!'
);

$count = 1;
Expand Down Expand Up @@ -46,4 +47,6 @@ string(14) "^#^&^;^`^|^*^?"
string(8) "^~^<^>^\"
-- Test 8 --
string(9) "^%NOENV^%"
-- Test 9 --
string(9) "^!NOENV^!"
Done

0 comments on commit 905c5f4

Please sign in to comment.