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: -
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:
Status: Open Package: PHAR related
PHP Version: 7.2.7 OS: Mac/Linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Dec 16 09:01:26 2018 UTC