Skip to content

Commit b06dfa2

Browse files
authored
Fix #22859 undefined symbol 'zip_file_set_encryption' (#22861)
Only when HAVE_ENCRYPTION is true, we can use the zip_file_set_encryption function. This commit add a guard to the zip_file_set_encryption symbol.
1 parent 83eea87 commit b06dfa2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

ext/zip/php_zip.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ static bool php_zip_set_file_comment(struct zip *za, zip_uint64_t index, const c
8282
# define add_ascii_assoc_string add_assoc_string
8383
# define add_ascii_assoc_long add_assoc_long
8484

85+
#ifdef HAVE_ENCRYPTION
8586
static bool php_zip_file_set_encryption(struct zip *intern, zend_long index, zend_long method, char *password) {
8687
// FIXME: is a workaround to reset/free the password in case of consecutive calls.
8788
// when libzip 1.11.5 is available, we can save this call in this case.
@@ -92,6 +93,7 @@ static bool php_zip_file_set_encryption(struct zip *intern, zend_long index, zen
9293

9394
return (zip_file_set_encryption(intern, (zip_uint64_t)index, (zip_uint16_t)method, password) == 0);
9495
}
96+
#endif
9597

9698
/* Flatten a path by making a relative path (to .)*/
9799
static char * php_zip_make_relative_path(char *path, size_t path_len) /* {{{ */

0 commit comments

Comments
 (0)