|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79912 Phar::decompressFiles not working
Submitted: 2020-07-29 16:17 UTC Modified: -
From: thenewherobrinex at gmail dot com Assigned:
Status: Open Package: PHAR related
PHP Version: 7.4.8 OS: MacOS
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: thenewherobrinex at gmail dot com
New email:
PHP Version: OS:


 [2020-07-29 16:17 UTC] thenewherobrinex at gmail dot com
Phar::decompressFiles marks the files in the PHAR as not compressed but when you extract the files from the PHAR they will be still compressed.

This is the same exact issue as just with Phar::decompressFiles instead of PharFileInfo::decompress.

Test script:
file_put_contents("test.txt", "This is a test file.");
$phar = new Phar("test.phar");
$file = $phar["test.txt"];
var_dump($file->compress(Phar::GZ)); //true (success)
var_dump($file->isCompressed()); //true (the file is compressed)
var_dump($phar->decompressFiles()); //true (success)
var_dump($file->isCompressed()); //false (the file should not be compressed anymore)
var_dump($phar->extractTo("test")); //true (success but the extracted file in the folder is compressed)


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Nov 27 18:01:25 2020 UTC