php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74619 ZipArchive::ExtractTo cuts off file names
Submitted: 2017-05-21 04:37 UTC Modified: 2018-02-14 16:27 UTC
Votes:2
Avg. Score:4.5 ± 0.5
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: megaone at yandex dot ru Assigned:
Status: Open Package: Zip Related
PHP Version: Irrelevant OS: Ubuntu, Debian
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2017-05-21 04:37 UTC] megaone at yandex dot ru
Description:
------------
ExtractTo cuts off non latin file names, no matter of codepage, til first space, so 'имя файла.txt' becomes ' файла.txt'. Filenames with no spaces gets cut off at all to extension only - '.txt'. getNameIndex returns full file names.


Also ZipArchive relies on default_charset. When default_charset is different from archive charset, files will be unpacked with broken names.


Problem appears on Ubuntu 12.04 with PHP 7.1.4 and with Debian 9 with PHP 7.0.16. First problem does not appear on Windows.






Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-05-25 15:34 UTC] megaone at yandex dot ru
I've found that basename() does exactly the same, so it's seem to be related.
 [2017-12-14 10:16 UTC] 937787082 at qq dot com
I have the same problem.I can use "unzip -O cp936" get the filename.The filenam is wrong when I use ZipArchive to get the file.
PHP 7.0.23 with Windows
 [2018-02-14 16:27 UTC] cmb@php.net
-Package: zip +Package: Zip Related
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Thu Oct 17 21:01:26 2019 UTC