php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76584 PharFileInfo::decompress not working
Submitted: 2018-07-05 21:21 UTC Modified: 2020-01-28 09:42 UTC
Votes:3
Avg. Score:3.0 ± 1.6
Reproduced:3 of 3 (100.0%)
Same Version:3 (100.0%)
Same OS:2 (66.7%)
From: thenewherobrinex at gmail dot com Assigned: cmb (profile)
Status: Closed Package: PHAR related
PHP Version: 7.3.5 OS: Mac/Linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: thenewherobrinex at gmail dot com
New email:
PHP Version: OS:

 

 [2018-07-05 21:21 UTC] thenewherobrinex at gmail dot com
Description:
------------
PharFileInfo::decompress marks the file in the phar as not compressed but when you extract the file from the phar it will be compressed.

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($file->decompress()); //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

Pull Requests

Pull requests:

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-05-06 22:21 UTC] thenewherobrinex at gmail dot com
-PHP Version: 7.2.7 +PHP Version: 7.3.5
 [2019-05-06 22:21 UTC] thenewherobrinex at gmail dot com
I just tested and I noticed that this bug is still there in 7.3.5
 [2020-01-26 14:07 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2020-01-26 14:07 UTC] cmb@php.net
The following pull request has been associated:

Patch Name: Fix #76584: PharFileInfo::decompress not working
On GitHub:  https://github.com/php/php-src/pull/5115
Patch:      https://github.com/php/php-src/pull/5115.patch
 [2020-01-28 09:41 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=136f51f1e1ce25a7d0150857d0846be8c8415a44
Log: Fix #76584: PharFileInfo::decompress not working
 [2020-01-28 09:41 UTC] cmb@php.net
-Status: Verified +Status: Closed
 [2020-01-28 09:42 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 09:01:28 2024 UTC