mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix #81420: ZipArchive::extractTo extracts outside of destination
We need to properly detect and handle absolute paths in a portable way.
This commit is contained in:
parent
521bd7ce15
commit
df2ceac25a
3 changed files with 26 additions and 2 deletions
|
@ -106,8 +106,8 @@ static char * php_zip_make_relative_path(char *path, size_t path_len) /* {{{ */
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (IS_SLASH(path[0])) {
|
||||
return path + 1;
|
||||
if (IS_ABSOLUTE_PATH(path, path_len)) {
|
||||
return path + COPY_WHEN_ABSOLUTE(path) + 1;
|
||||
}
|
||||
|
||||
i = path_len;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue