|  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
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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: megaone at yandex dot ru
New email:
PHP Version: OS:


 [2017-05-21 04:37 UTC] megaone at yandex dot ru
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.


Add a Patch

Pull Requests

Add a Pull Request


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]
-Package: zip +Package: Zip Related
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Oct 18 02:03:34 2021 UTC