From 32c4aed9cdbf26cd6297ff4cb7327475e49cb47c Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 11 Feb 2026 13:31:01 +1100 Subject: [PATCH 1/2] Remove ifdef guards for ZIP_RDONLY ZIP_RDONLY was introduced in libzip 1.0.0 which is required since a979e9f897a90a580e883b1f39ce5673686ffc67 --- ext/zip/php_zip.c | 4 ---- ext/zip/php_zip.stub.php | 2 -- ext/zip/php_zip_arginfo.h | 2 -- 3 files changed, 8 deletions(-) diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index 4ff362bab15d2..7198fe99d31fd 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -1463,11 +1463,7 @@ PHP_METHOD(ZipArchive, open) } /* open for write without option to empty the archive */ -#ifdef ZIP_RDONLY if ((flags & (ZIP_TRUNCATE | ZIP_RDONLY)) == 0) { -#else - if ((flags & ZIP_TRUNCATE) == 0) { -#endif zend_stat_t st = {0}; /* exists and is empty */ diff --git a/ext/zip/php_zip.stub.php b/ext/zip/php_zip.stub.php index 8a37b2508da18..2f055e83d34dd 100644 --- a/ext/zip/php_zip.stub.php +++ b/ext/zip/php_zip.stub.php @@ -82,12 +82,10 @@ class ZipArchive implements Countable * @cvalue ZIP_OVERWRITE */ public const int OVERWRITE = UNKNOWN; -#ifdef ZIP_RDONLY /** * @cvalue ZIP_RDONLY */ public const int RDONLY = UNKNOWN; -#endif /** * @cvalue ZIP_FL_NOCASE diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h index 2c5191d6fbd0f..380458283c4bc 100644 --- a/ext/zip/php_zip_arginfo.h +++ b/ext/zip/php_zip_arginfo.h @@ -550,14 +550,12 @@ static zend_class_entry *register_class_ZipArchive(zend_class_entry *class_entry zend_string *const_OVERWRITE_name = zend_string_init_interned("OVERWRITE", sizeof("OVERWRITE") - 1, true); zend_declare_typed_class_constant(class_entry, const_OVERWRITE_name, &const_OVERWRITE_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(const_OVERWRITE_name, true); -#if defined(ZIP_RDONLY) zval const_RDONLY_value; ZVAL_LONG(&const_RDONLY_value, ZIP_RDONLY); zend_string *const_RDONLY_name = zend_string_init_interned("RDONLY", sizeof("RDONLY") - 1, true); zend_declare_typed_class_constant(class_entry, const_RDONLY_name, &const_RDONLY_value, ZEND_ACC_PUBLIC, NULL, (zend_type) ZEND_TYPE_INIT_MASK(MAY_BE_LONG)); zend_string_release_ex(const_RDONLY_name, true); -#endif zval const_FL_NOCASE_value; ZVAL_LONG(&const_FL_NOCASE_value, ZIP_FL_NOCASE); From 72e05b199f1a175eb2c441c9ddb2bd2214e30108 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 11 Feb 2026 13:40:27 +1100 Subject: [PATCH 2/2] Regenerate arginfo --- ext/zip/php_zip_arginfo.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/zip/php_zip_arginfo.h b/ext/zip/php_zip_arginfo.h index 380458283c4bc..f3d081daf04d6 100644 --- a/ext/zip/php_zip_arginfo.h +++ b/ext/zip/php_zip_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit php_zip.stub.php instead. - * Stub hash: 1f77735273373672b9c8c5b92c46e23ea99faeaf */ + * Stub hash: 030038017c7c76195c0b0dc2392696f458c2471f */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0)