From: lajbr at seznam dot cz
Operating system: Windows 2003 Server
PHP version: 5.1.6
PHP Bug Type: Reproducible crash
Bug description: Problem with reading of .ZIP file content
Description:
------------
I found a serious problem on PHP 5.1.6 (5.1.4 too). I try to read content
of .ZIP file (part of code is added below). I open an existing ZIP file
and I want to read its content. But Warning message with following text is
appeared (text is added below). The same problem occured when I use
function zip_close(). As the result nothing is happened (no content from
ZIP file is readed). When I go back to PHP version 5.0.5 then all works
fine.
Reproduce code:
---------------
function ziplist($zipfile){
$retval = array();
if ($sourcezip = @zip_open($zipfile)) {
while ($zip_entry = zip_read($sourcezip)) {
array_push($retval,array('filename' => zip_entry_name($zip_entry),
'filesize' =>
zip_entry_filesize($zip_entry)));
}
zip_close($sourcezip);
} else return false;
return $retval;
}
Expected result:
----------------
Warning: zip_read() expects parameter 1 to be resource, integer given in
C:\Inetpub\wwwroot\epo\include\function.php on line 439
Warning: zip_close() expects parameter 1 to be resource, integer given in
C:\Inetpub\wwwroot\epo\include\function.php on line 443
--
Edit bug report at http://bugs.php.net/?id=39231&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=39231&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=39231&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=39231&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39231&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=39231&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39231&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39231&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39231&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39231&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39231&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=39231&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=39231&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39231&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39231&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39231&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39231&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39231&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39231&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39231&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39231&r=mysqlcfg