[php-src] Issue #8528: Meta data of ZirArchive::getStream() is not consistent with zip:// protocol
| From: | walkonthemarz | Date: | Tue, 10 May 2022 14:45:32 +0000 |
| Subject: | [php-src] Issue #8528: Meta data of ZirArchive::getStream() is not consistent with zip:// protocol | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-241452@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/8528
Author: walkonthemarz
### Description
The following code:
```php
<?php
$zip = new ZipArchive();
$zip->open('test.zip');
var_dump(stream_get_meta_data($zip->getStream('text.txt')));
var_dump(stream_get_meta_data(fopen('zip://test.zip#text.txt', 'r')));
```
Resulted in this output:
```
array(8) {
["timed_out"]=>
bool(false)
["blocked"]=>
bool(true)
["eof"]=>
bool(false)
["stream_type"]=>
string(3) "zip"
["mode"]=>
string(2) "rb"
["unread_bytes"]=>
int(0)
["seekable"]=>
bool(false)
["uri"]=>
string(8) "text.txt"
}
array(9) {
["timed_out"]=>
bool(false)
["blocked"]=>
bool(true)
["eof"]=>
bool(false)
["wrapper_type"]=>
string(11) "zip wrapper"
["stream_type"]=>
string(3) "zip"
["mode"]=>
string(1) "r"
["unread_bytes"]=>
int(0)
["seekable"]=>
bool(false)
["uri"]=>
string(23) "zip://test.zip#text.txt"
}
```
The meta data of ZirArchive::getStream() method doesn't contain the wrapper_type attribute that
is not consistent with fopen('zip://test.zip#text.txt', 'r').
### PHP Version
PHP 8.1.10
### Operating System
Darwin Kernel Version 21.4.0