Commit b9b44872d72 for php.net
commit b9b44872d72dc66bcea72232a2bc79a3b63a0c3b
Merge: 24f2ba08a17 d5f57318613
Author: David Carlier <devnexen@gmail.com>
Date: Sat Aug 8 21:27:33 2026 +0100
Merge branch 'PHP-8.5'
* PHP-8.5:
ext/zip: addGlob() and addPattern() ignore their default options.
diff --cc ext/zip/php_zip.c
index 4bc74796889,d2f1f0326ee..4b5f4d64c0a
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@@ -369,22 -372,13 +375,15 @@@ static zend_result php_zip_parse_option
/* {{{ */
{
zval *option;
+ zend_long tmp;
+ bool failed = false;
- /* default values */
- opts->flags = ZIP_FL_OVERWRITE;
- opts->comp_method = -1; /* -1 to not change default */
- #ifdef HAVE_ENCRYPTION
- opts->enc_method = -1; /* -1 to not change default */
- #endif
-
if ((option = zend_hash_str_find(options, "remove_all_path", sizeof("remove_all_path") - 1)) != NULL) {
if (Z_TYPE_P(option) != IS_FALSE && Z_TYPE_P(option) != IS_TRUE) {
- php_error_docref(NULL, E_WARNING, "Option \"remove_all_path\" must be of type bool, %s given",
- zend_zval_value_name(option));
+ zend_type_error("Option \"remove_all_path\" must be of type bool, %s given", zend_zval_value_name(option));
+ return FAILURE;
}
- opts->remove_all_path = zval_get_long(option);
+ opts->remove_all_path = Z_TYPE_P(option) == IS_TRUE;
}
if ((option = zend_hash_str_find(options, "comp_method", sizeof("comp_method") - 1)) != NULL) {