Skip to content

Commit 5215f07

Browse files
committed
- bump zip extension version to 1.15.6
- add ZipArchive::LIBZIP_VERSION - skip bug53885.phpt with libzip 1.6.0 (empty file is no more valid archive)
1 parent ea1b878 commit 5215f07

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

NEWS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ PHP NEWS
4747

4848
- Zip:
4949
. Add ZipArchive::CM_LZMA2 constant (since libzip 1.6.0). (remi)
50+
. Add ZipArchive::LIBZIP_VERSION constant. (remi)
5051

5152
23 Jan 2020, PHP 7.4.2
5253

ext/zip/php_zip.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3147,6 +3147,12 @@ static PHP_MINIT_FUNCTION(zip)
31473147
REGISTER_ZIP_CLASS_CONST_LONG("EM_AES_256", ZIP_EM_AES_256);
31483148
#endif
31493149

3150+
#if HAVE_LIBZIP_VERSION
3151+
zend_declare_class_constant_string(zip_class_entry, "LIBZIP_VERSION", sizeof("LIBZIP_VERSION")-1, zip_libzip_version());
3152+
#else
3153+
zend_declare_class_constant_string(zip_class_entry, "LIBZIP_VERSION", sizeof("LIBZIP_VERSION")-1, LIBZIP_VERSION);
3154+
#endif
3155+
31503156
php_register_url_stream_wrapper("zip", &php_stream_zip_wrapper);
31513157

31523158
le_zip_dir = zend_register_list_destructors_ex(php_zip_free_dir, NULL, le_zip_dir_name, module_number);

ext/zip/php_zip.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ extern zend_module_entry zip_module_entry;
3333
#define ZIP_OVERWRITE ZIP_TRUNCATE
3434
#endif
3535

36-
#define PHP_ZIP_VERSION "1.15.5"
36+
#define PHP_ZIP_VERSION "1.15.6"
3737

3838
#define ZIP_OPENBASEDIR_CHECKPATH(filename) php_check_open_basedir(filename)
3939

ext/zip/tests/bug53885.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Bug #53885 (ZipArchive segfault with FL_UNCHANGED on empty archive)
33
--SKIPIF--
44
<?php
55
if(!extension_loaded('zip')) die('skip');
6+
if(version_compare(ZipArchive::LIBZIP_VERSION, '1.6', '>=')) die('skip libzip too recent');
67
?>
78
--FILE--
89
<?php

0 commit comments

Comments
 (0)