Bug #76061 [NEW]: Phar wrapper and extensionless files
| From: | maikuolan at gmail dot com | Date: | Tue, 06 Mar 2018 13:19:56 +0000 |
| Subject: | Bug #76061 [NEW]: Phar wrapper and extensionless files | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-214223@lists.php.net to get a copy of this message | ||
From: maikuolan at gmail dot com
Operating system: Linux/*nix/Win
PHP version: Irrelevant
Package: PHAR related
Bug Type: Bug
Bug description:Phar wrapper and extensionless files
Description:
------------
Attempting to access extensionless ZIP archives using the
phar://
wrapper results in errors.
Examples (assumes the file being read is an arbitrary ZIP archive
containing one or more files):
This:
```
%PATH%>php.exe -r "$foo=scandir('phar://x:/xxx.xxx');var_dump($foo);
```
..generates an array whereby elements represent the files contained by
the archive (expected).
Whereas this:
```
%PATH%>php.exe -r "$foo=scandir('phar://x:/xxx');var_dump($foo);
```
..generates this (not expected):
```
PHP Warning: scandir(phar://x:/xxx): failed to open dir: phar error: no
directory in "phar://x:/xxx", must have at least phar://x:/xxx/ for root
directory (always use full path to a new phar)
phar url "phar://x:/xxx" is unknown in Command line code on line 1
PHP Warning: scandir(): (errno 9): Bad file descriptor in Command line
code on line 1
bool(false)
```
Bug discovered via: https://github.com/phpMussel/phpMussel/issues/155
Reproduced against latest releases on all currently supported branches
(5.6, 7.0, 7.1, 7.2). Not tested against any older versions or
unsupported branches.
--
Edit bug report at https://bugs.php.net/bug.php?id=76061&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=76061&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=76061&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=76061&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=76061&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=76061&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=76061&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=76061&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=76061&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=76061&r=support
Expected behavior: https://bugs.php.net/fix.php?id=76061&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=76061&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=76061&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=76061&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=76061&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=76061&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=76061&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=76061&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=76061&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=76061&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=76061&r=mysqlcfg