From ad4fa8f75810facff8bea509249a735232235443 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 24 Sep 2015 22:39:59 +0300 Subject: Fixed incorrect usage of HASH_OF() macro. Replaced HASH_OF() with more appropriate Z_ARRVAL_P() or Z_OBJPROP_P(). --- ext/zip/php_zip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/zip/php_zip.c') diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index f68534c48d..0e0d5db725 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -314,12 +314,12 @@ static int php_zip_add_file(struct zip *za, const char *filename, size_t filenam static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char **remove_path, size_t *remove_path_len, char **add_path, size_t *add_path_len) /* {{{ */ { zval *option; - if ((option = zend_hash_str_find(HASH_OF(options), "remove_all_path", sizeof("remove_all_path") - 1)) != NULL) { + if ((option = zend_hash_str_find(Z_ARRVAL_P(options), "remove_all_path", sizeof("remove_all_path") - 1)) != NULL) { *remove_all_path = zval_get_long(option); } /* If I add more options, it would make sense to create a nice static struct and loop over it. */ - if ((option = zend_hash_str_find(HASH_OF(options), "remove_path", sizeof("remove_path") - 1)) != NULL) { + if ((option = zend_hash_str_find(Z_ARRVAL_P(options), "remove_path", sizeof("remove_path") - 1)) != NULL) { if (Z_TYPE_P(option) != IS_STRING) { php_error_docref(NULL, E_WARNING, "remove_path option expected to be a string"); return -1; @@ -339,7 +339,7 @@ static int php_zip_parse_options(zval *options, zend_long *remove_all_path, char *remove_path = Z_STRVAL_P(option); } - if ((option = zend_hash_str_find(HASH_OF(options), "add_path", sizeof("add_path") - 1)) != NULL) { + if ((option = zend_hash_str_find(Z_ARRVAL_P(options), "add_path", sizeof("add_path") - 1)) != NULL) { if (Z_TYPE_P(option) != IS_STRING) { php_error_docref(NULL, E_WARNING, "add_path option expected to be a string"); return -1; -- cgit v1.2.1