mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-5.6'
* PHP-5.6: Fix #70264: CLI server directory traversal
This commit is contained in:
commit
fc444896af
2 changed files with 33 additions and 0 deletions
|
@ -1469,6 +1469,18 @@ static void normalize_vpath(char **retval, size_t *retval_len, const char *vpath
|
|||
|
||||
decoded_vpath_end = decoded_vpath + php_url_decode(decoded_vpath, (int)vpath_len);
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
{
|
||||
char *p = decoded_vpath;
|
||||
|
||||
do {
|
||||
if (*p == '\\') {
|
||||
*p = '/';
|
||||
}
|
||||
} while (*p++);
|
||||
}
|
||||
#endif
|
||||
|
||||
p = decoded_vpath;
|
||||
|
||||
if (p < decoded_vpath_end && *p == '/') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue