summaryrefslogtreecommitdiff
path: root/ext/zip/php_zip.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-05-03 11:49:31 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-05-06 19:15:34 +0200
commitdaa5b26456820a2414ad2fe0c264df44b43d13ff (patch)
tree8ea15abcf3583669d4b293062c4b3d631bd8df42 /ext/zip/php_zip.c
parent78dda268eb2887709bdcbb7697785e80e231d58f (diff)
downloadphp-git-daa5b26456820a2414ad2fe0c264df44b43d13ff.tar.gz
Fix UNKNOWN default values in ext/zip
Diffstat (limited to 'ext/zip/php_zip.c')
-rw-r--r--ext/zip/php_zip.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c
index 2d3b3c3107..dc60312285 100644
--- a/ext/zip/php_zip.c
+++ b/ext/zip/php_zip.c
@@ -1725,6 +1725,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
php_error_docref(NULL, E_NOTICE, "Empty string as pattern");
RETURN_FALSE;
}
+ if (options && zend_hash_num_elements(Z_ARRVAL_P(options)) > 0 && (php_zip_parse_options(options, &opts) < 0)) {
RETURN_FALSE;
}
@@ -2302,9 +2303,7 @@ static ZIPARCHIVE_METHOD(setEncryptionName)
char *name, *password = NULL;
size_t name_len, password_len;
- ZIP_FROM_OBJECT(intern, self);
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sl|s!",
&name, &name_len, &method, &password, &password_len) == FAILURE) {
RETURN_THROWS();
}
@@ -2337,14 +2336,14 @@ static ZIPARCHIVE_METHOD(setEncryptionIndex)
char *password = NULL;
size_t password_len;
-
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ll|s!",
&index, &method, &password, &password_len) == FAILURE) {
RETURN_THROWS();
}
- if (zip_file_set_encryption(intern, index, (zip_uint16_t)method, password)) {
ZIP_FROM_OBJECT(intern, self);
+
+ if (zip_file_set_encryption(intern, index, (zip_uint16_t)method, password)) {
RETURN_FALSE;
}
RETURN_TRUE;
@@ -2766,6 +2765,7 @@ static ZIPARCHIVE_METHOD(extractTo)
size_t pathto_len;
int ret;
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|z", &pathto, &pathto_len, &zval_files) == FAILURE) {
RETURN_THROWS();
}
@@ -2776,10 +2776,10 @@ static ZIPARCHIVE_METHOD(extractTo)
}
if (php_stream_stat_path_ex(pathto, PHP_STREAM_URL_STAT_QUIET, &ssb, NULL) < 0) {
- ret = php_stream_mkdir(pathto, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL);
- if (!ret) {
- RETURN_FALSE;
- }
+ ret = php_stream_mkdir(pathto, 0777, PHP_STREAM_MKDIR_RECURSIVE, NULL);
+ if (!ret) {
+ RETURN_FALSE;
+ }
}
if (zval_files && Z_TYPE_P(zval_files) != IS_NULL) {