php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66972 $ZipArchive->addFile() don't see phar-inside file
Submitted: 2014-03-28 15:08 UTC Modified: 2021-06-13 04:22 UTC
From: sailormax at inbox dot lv Assigned: cmb (profile)
Status: No Feedback Package: Zip Related
PHP Version: master-Git-2014-03-28 (Git) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: sailormax at inbox dot lv
New email:
PHP Version: OS:

 

 [2014-03-28 15:08 UTC] sailormax at inbox dot lv
Description:
------------
Looks like $ZipArchive->addFile() don't see source file, if it placed near the executed script inside PHAR.

Steps:
1. create phar-file with:
- embed.xml with any data;
- index.php with:
~~~~
$objZip = new ZipArchive();
$objZip->open("test.zip", ZIPARCHIVE::CREATE);
$objZip->addFile(dirname(__FILE__) . '/embed.xml', 'test/embed.xml');
$objZip->close();
~~~~

Exp: test.zip with embed.xml
Act: test.zip without embed.xml . addFile() return false;

Test script:
---------------
$objZip = new ZipArchive();
$objZip->open("test.zip", ZIPARCHIVE::CREATE);
$objZip->addFile(dirname(__FILE__) . '/embed.xml', 'test/embed.xml');
$objZip->close();

Expected result:
----------------
test.zip with embed.xml

Actual result:
--------------
test.zip without embed.xml . addFile() return false;

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-02 08:02 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2014-04-02 08:02 UTC] ab@php.net
Can't reproduce. Does this work from cli for you? It only fails by a real error, like if embed.xml doesn't exits.
 [2014-04-02 20:35 UTC] sailormax at inbox dot lv
-Status: Feedback +Status: Open
 [2014-04-02 20:35 UTC] sailormax at inbox dot lv
Actually I compressed PHPWord ( https://phpword.codeplex.com ) and result has this error.
I'll retest my sample little later.

thank you.
 [2015-04-16 12:52 UTC] cmb@php.net
-Package: zip +Package: Zip Related
 [2021-05-31 14:42 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-05-31 14:42 UTC] cmb@php.net
So, is this still an issue with any of the actively supported PHP
versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-06-13 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 20:01:30 2024 UTC