Bug #72412 [Com]: PharData for archive containing "relative current directory" ( ./ )
[email protected] ("nowytmp3 dot com at gmail dot com")
| Newsgroups | php.bugs |
|---|---|
| Message-ID | <[email protected]> |
Edit report at https://bugs.php.net/bug.php?id=72412&edit=1
ID: 72412
Comment by: nowytmp3 dot com at gmail dot com
Reported by: raphael dot droz at gmail dot com
Summary: PharData for archive containing "relative current
directory" ( ./ )
Status: Open
Type: Bug
Package: PHAR related
Operating System: Linux
PHP Version: 5.6.22
Block user comment: N
Private report: N
New Comment:
same problem, but i have done the follow. change my system to ubuntu 14.04 and now its working. also with 16.04. why i don´t now but my mp3 youtube converter site is now working. you can check this on: http://mp3-youtube-converter.com
Previous Comments:
------------------------------------------------------------------------
[2016-06-15 13:24:01] raphael dot droz at gmail dot com
Description:
------------
When creating a tar archive containing .
Phar seems unable to extract it.
Extracting ./file1 would work, but listing or extracting the whole archive does not seem possible and fail with a Fatal internal error.
This is especially annoying if you don't know in advance the name of the file to extract: in such case the archive is simply unsuitable for Phar.
As seen on IRC, it (july 14th), it does not affect every PHP version.
Maybe related to bug #64884 since some symptoms seem common.
Test script:
---------------
mkdir -p test1;
echo "This is a test file" > test1/file1;
tar czf test1.tar.gz -C test1 .
php -r '$p = new PharData("/tmp/test1.tar.gz"); $p->extractTo("test2");'
cat test2/file1
Expected result:
----------------
This is a test file
Actual result:
--------------
Extraction from phar "/tmp/test1.tar.gz" failed: Cannot extract ".", internal error in Command line code on line 1
# Note that the "test1" directory is created, but empty
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72412&edit=1