PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » File Formats » Archive_Zip » Bug #8729

"." entries not being properly excluded

Details

Submitted2006-09-19 01:25 UTC
Fromtim at skypanther dot com
StatusSuspended
PackageArchive_Zip
PHP Version4.4.2
OSLinux
Roadmaps(Not assigned)

Comments

[2006-09-19 01:25 UTC] tim at skypanther dot com

Description:
------------
It seems that the zip class was trying to include the '.' entry. I was getting output like this:

Warning: is_file(): Stat failed for
files/./././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././.
in /home/username/public_html/scripts/core/Zip.php on line 1216

Test script:
---------------
Lines starting at approx 1208 are:
=========================================================
// ----- Read the directory for files and sub-directories
$p_hdir = opendir($p_filename);
$p_hitem = readdir($p_hdir); // '.' directory
$p_hitem = readdir($p_hdir); // '..' directory

while ($p_hitem = readdir($p_hdir))
{
=========================================================

This code should be changed to:

I added the following following the opening brace of the while block:

=========================================================
// ----- Read the directory for files and sub-directories
$p_hdir = opendir($p_filename);
// $p_hitem = readdir($p_hdir); // '.' directory
// $p_hitem = readdir($p_hdir); // '..' directory

while ($p_hitem = readdir($p_hdir))
{
if ($p_hitem == "." || $p_hitem == "..") continue;
=========================================================

[2006-09-19 01:27 UTC] tim at skypanther dot com

Ignore the "I added the following following the opening brace of the while block:" line. I started entering this one way, changed my mind and forgot to delete it.