Skip to content

Commit cb1b26a

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: - 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)
2 parents 8dd91f5 + 5215f07 commit cb1b26a

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

ext/zip/php_zip.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2902,6 +2902,12 @@ static PHP_MINIT_FUNCTION(zip)
29022902
REGISTER_ZIP_CLASS_CONST_LONG("EM_AES_256", ZIP_EM_AES_256);
29032903
#endif
29042904

2905+
#if HAVE_LIBZIP_VERSION
2906+
zend_declare_class_constant_string(zip_class_entry, "LIBZIP_VERSION", sizeof("LIBZIP_VERSION")-1, zip_libzip_version());
2907+
#else
2908+
zend_declare_class_constant_string(zip_class_entry, "LIBZIP_VERSION", sizeof("LIBZIP_VERSION")-1, LIBZIP_VERSION);
2909+
#endif
2910+
29052911
php_register_url_stream_wrapper("zip", &php_stream_zip_wrapper);
29062912

29072913
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
@@ -31,7 +31,7 @@ extern zend_module_entry zip_module_entry;
3131
#define ZIP_OVERWRITE ZIP_TRUNCATE
3232
#endif
3333

34-
#define PHP_ZIP_VERSION "1.15.5"
34+
#define PHP_ZIP_VERSION "1.15.6"
3535

3636
#define ZIP_OPENBASEDIR_CHECKPATH(filename) php_check_open_basedir(filename)
3737

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)