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: 2021-01-19 09:33 UTC
From: thenewherobrinex at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: PHAR related
PHP Version: 7.4.8 OS: MacOS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
25 + 50 = ?
Subscribe to this entry?

 
 [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

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-08 13:46 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2021-01-19 09:33 UTC] cmb@php.net
Actually, this appears to be a duplicate of bug #69279.
 [2021-01-19 09:33 UTC] cmb@php.net
-Status: Verified +Status: Duplicate -Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 07:01:32 2024 UTC