Skip to content

Commit a951792

Browse files
committed
fix last change
1 parent fa1f5f1 commit a951792

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ext/zip/php_zip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ static zend_result php_zip_parse_options(HashTable *options, zip_options *opts)
389389
if (comp_flags < 0 || comp_flags > USHRT_MAX) {
390390
php_error_docref(NULL, E_WARNING, "Option \"comp_flags\" must be between 0 and %u", USHRT_MAX);
391391
}
392-
opts->comp_flags = zval_get_long(option);
392+
opts->comp_flags = (zip_uint32_t)comp_flags;
393393
}
394394
}
395395

@@ -1767,7 +1767,7 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
17671767
}
17681768
#ifdef HAVE_ENCRYPTION
17691769
if (opts.enc_method >= 0) {
1770-
if (php_zip_file_set_encryption(ze_obj->za, ze_obj->last_id, opts.enc_method, opts.enc_password)) {
1770+
if (!php_zip_file_set_encryption(ze_obj->za, ze_obj->last_id, opts.enc_method, opts.enc_password)) {
17711771
zend_array_destroy(Z_ARR_P(return_value));
17721772
RETURN_FALSE;
17731773
}

ext/zip/tests/oo_addglob2.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ include $dirname . 'utils.inc';
7878
rmdir_rf(__DIR__ . '/__tmp_oo_addglob2/');
7979
?>
8080
--EXPECTF--
81+
8182
Warning: ZipArchive::addGlob(): Option "comp_flags" must be between 0 and 65535 in %s on line %d
8283

8384
Warning: ZipArchive::addGlob(): Option "comp_flags" must be between 0 and 65535 in %s on line %d

0 commit comments

Comments
 (0)