Bug #68621 [Asn]: Filename appends the base url.
| From: | cmb@php.net | Date: | Thu, 16 Apr 2015 13:11:23 +0000 |
| Subject: | Bug #68621 [Asn]: Filename appends the base url. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-192134@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68621&edit=1
ID: 68621
Updated by: cmb@php.net
Reported by: your dot brother dot t at hotmail dot com
Summary: Filename appends the base url.
Status: Assigned
Type: Bug
-Package: zip
+Package: Zip Related
Operating System: Cross OS
PHP Version: all
Assigned To: neeke
Block user comment: N
Private report: N
New Comment:
What's the status here? It seems the PR has been closed on 9 Mar
without having been merged into upstream.
Previous Comments:
------------------------------------------------------------------------
[2015-04-06 13:33:21] neeke@php.net
https://github.com/php/php-src/pull/1159
------------------------------------------------------------------------
[2014-12-18 13:56:22] your dot brother dot t at hotmail dot com
Description:
------------
---
From manual page: http://www.php.net/ziparchive.open
---
The ZipArchive::open treats the filename not as defined per php manual on valid file wrappers. It
appends the filename to the base url. Hence, creating/manipulating a zip file in memory space would
be impossible.
Test script:
---------------
$zip = new \ZipArchive();
if (!($err = $zip->open("php://memory", \ZipArchive::CREATE)))
{
die(var_dump($err));
}
$zip->addFromString("test.txt", "sample text");
die(var_dump($zip));
Expected result:
----------------
object(ZipArchive)[206]
public 'status' => int 0
public 'statusSys' => int 0
public 'numFiles' => int 1
public 'filename' => string 'php://memory' (length=54)
public 'comment' => string '' (length=0)
Actual result:
--------------
object(ZipArchive)[206]
public 'status' => int 0
public 'statusSys' => int 0
public 'numFiles' => int 1
public 'filename' => string
'D:\servers\www\html\Laravel\sandbox\public\php:\memory' (length=54)
public 'comment' => string '' (length=0)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68621&edit=1