php.net |  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [2020-07-29 16:17 UTC] thenewherobrinex at gmail dot com
Description:
------------
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 https://bugs.php.net/bug.php?id=76584 just with Phar::decompressFiles instead of PharFileInfo::decompress.

Test script:
---------------
<?php
file_put_contents("test.txt", "This is a test file.");
$phar = new Phar("test.phar");
$phar->addFile("test.txt");
$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)


Patches

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