FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16481&edit=1

ID: 16481
Updated by: daniel.oconnor@gmail.com
Reported By: kamazee at gmail dot com
Summary: Wrong way of getting directory listing
-Status: Open
+Status: Wont fix
Type: Bug
Package: Archive_Zip
Operating System: Debian
Package Version: 0.1.1
PHP Version: 5.3.0
Roadmap Versions:
New Comment:

-Status: Open
+Status: Wont fix
Thanks for the fix Alex; but this one is unfortunately a wontfix - the
zip extension
does a much better job and has superceeded this package.


Previous Comments:
------------------------------------------------------------------------

[2009-07-30 12:47:53] kamazee

Description:
------------
Just for crazy people who still using this lib.
(Lines from 1209)
$p_hdir = opendir($p_filename);
$p_hitem = readdir($p_hdir); // '.' directory
$p_hitem = readdir($p_hdir); // '..' directory
while ($p_hitem = readdir($p_hdir))
{

'.' and '..' are not always above the real files in listing. So we get
an infinitive cycle.
If there is a file named like '0' the rest of files won't be listed at
all.

Solution.
Replace the piece of code above with the following:

$p_hdir = opendir($p_filename);

while (FALSE !== ($p_hitem = readdir($p_hdir)))
{
if($p_hitem === '.' OR $p_hitem === '..')
continue;

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJul 30, '11 at 9:38a
activeJul 30, '11 at 9:38a
posts1
users1
websitepear.php.net

1 user in discussion

Daniel Oconnor: 1 post

People

Translate

site design / logo © 2022 Grokbase