[PHP-DEV] Bug #11675: zzip_open() has a wrong arg count and doesn't validate arg2 correctly From: phpbug <email protected>
Date: 06/25/01

From: phpbug <email protected>
Operating system: n/a
PHP version: 4.0.6
PHP Bug Type: ZZiplib Related
Bug description: zzip_open() has a wrong arg count and doesn't validate arg2 correctly

See patch at: http://pfft.net/robin/pub/zzip.patch

Then, correct use seems to be:
$zzip = zzip_opendir("foo.zip");
if($zzip)
{
  while ($zzip_entry = zzip_readdir($zzip))
  {
    echo "zzip_entry_name: " . zzip_entry_name($zzip_entry) . "\n";
    echo "zzip_entry_filesize: " . zzip_entry_filesize($zzip_entry) . "\n";

    if(zzip_open($zzip, $zzip_entry, "r"))
    {
      $buf = zzip_read($zzip_entry, zzip_entry_filesize($zzip_entry));
      zzip_close($zzip_entry);
      echo "read: " . strlen($buf) . " bytes\n";
    }
  }
  zzip_closedir($zzip);
}

-- 
Edit Bug report at: http://bugs.php.net/?id=11675&edit=1

-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>