]> granicus.if.org Git - php/commitdiff
- bump zip extension version to 1.15.6
authorRemi Collet <remi@php.net>
Mon, 27 Jan 2020 15:47:28 +0000 (16:47 +0100)
committerRemi Collet <remi@php.net>
Mon, 27 Jan 2020 15:47:28 +0000 (16:47 +0100)
- add ZipArchive::LIBZIP_VERSION
- skip bug53885.phpt with libzip 1.6.0 (empty file is no more valid archive)

NEWS
ext/zip/php_zip.c
ext/zip/php_zip.h
ext/zip/tests/bug53885.phpt

diff --git a/NEWS b/NEWS
index d1d193e9c20dc28b1bc32cf8295e59424adedc9e..1eed1627b7d8897b011b0a6f5515c001243af657 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -47,6 +47,7 @@ PHP                                                                        NEWS
 
 - Zip:
   . Add ZipArchive::CM_LZMA2 constant (since libzip 1.6.0). (remi)
+  . Add ZipArchive::LIBZIP_VERSION constant. (remi)
 
 23 Jan 2020, PHP 7.4.2
 
index b2ac60e9ec96a72eb3984652b6804bdc283f98e3..bec14f7f77b1eedd46fbd186224392133570e05f 100644 (file)
@@ -3147,6 +3147,12 @@ static PHP_MINIT_FUNCTION(zip)
        REGISTER_ZIP_CLASS_CONST_LONG("EM_AES_256",                             ZIP_EM_AES_256);
 #endif
 
+#if HAVE_LIBZIP_VERSION
+       zend_declare_class_constant_string(zip_class_entry, "LIBZIP_VERSION", sizeof("LIBZIP_VERSION")-1, zip_libzip_version());
+#else
+       zend_declare_class_constant_string(zip_class_entry, "LIBZIP_VERSION", sizeof("LIBZIP_VERSION")-1, LIBZIP_VERSION);
+#endif
+
        php_register_url_stream_wrapper("zip", &php_stream_zip_wrapper);
 
        le_zip_dir   = zend_register_list_destructors_ex(php_zip_free_dir,   NULL, le_zip_dir_name,   module_number);
index dc5a7ddfdd6141139d01f926199f6a54a0d4f457..7caf65f0068ec8491ccf3223ec3fa68740990ed7 100644 (file)
@@ -33,7 +33,7 @@ extern zend_module_entry zip_module_entry;
 #define ZIP_OVERWRITE ZIP_TRUNCATE
 #endif
 
-#define PHP_ZIP_VERSION "1.15.5"
+#define PHP_ZIP_VERSION "1.15.6"
 
 #define ZIP_OPENBASEDIR_CHECKPATH(filename) php_check_open_basedir(filename)
 
index 6f95a661b323bad98a51615936b9cde28cc710f0..75f6fe1609eaabaf0a0e958eafdd87b24bff9f2e 100644 (file)
@@ -3,6 +3,7 @@ Bug #53885 (ZipArchive segfault with FL_UNCHANGED on empty archive)
 --SKIPIF--
 <?php
 if(!extension_loaded('zip')) die('skip');
+if(version_compare(ZipArchive::LIBZIP_VERSION, '1.6', '>=')) die('skip libzip too recent');
 ?>
 --FILE--
 <?php