X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_cookie.c;h=ff67b1c1d2c6ed2a189f2e18647b9db196ac53b2;hp=a43928b833f2f647813a24adedf1d8e4d9188754;hb=0347914eda73287d017c6512dfe870382312299a;hpb=d01985309a42186e0c3ac1e8dd6e2d4a094d30c9 diff --git a/php_http_cookie.c b/php_http_cookie.c index a43928b..ff67b1c 100644 --- a/php_http_cookie.c +++ b/php_http_cookie.c @@ -235,16 +235,16 @@ php_http_cookie_list_t *php_http_cookie_list_from_struct(php_http_cookie_list_t ht = HASH_OF(strct); list = php_http_cookie_list_init(list); - if ((tmp = zend_hash_str_find(ht, ZEND_STRL("cookies"))) && Z_TYPE_P(tmp) == IS_ARRAY){ + if ((tmp = zend_hash_str_find_ind(ht, ZEND_STRL("cookies"))) && Z_TYPE_P(tmp) == IS_ARRAY){ array_copy(Z_ARRVAL_P(tmp), &list->cookies); } - if ((tmp = zend_hash_str_find(ht, ZEND_STRL("extras"))) && Z_TYPE_P(tmp) == IS_ARRAY){ + if ((tmp = zend_hash_str_find_ind(ht, ZEND_STRL("extras"))) && Z_TYPE_P(tmp) == IS_ARRAY){ array_copy(Z_ARRVAL_P(tmp), &list->extras); } - if ((tmp = zend_hash_str_find(ht, ZEND_STRL("flags")))) { + if ((tmp = zend_hash_str_find_ind(ht, ZEND_STRL("flags")))) { list->flags = zval_get_long(tmp); } - if ((tmp = zend_hash_str_find(ht, ZEND_STRL("expires")))) { + if ((tmp = zend_hash_str_find_ind(ht, ZEND_STRL("expires")))) { if (Z_TYPE_P(tmp) == IS_LONG) { list->expires = Z_LVAL_P(tmp); } else { @@ -260,7 +260,7 @@ php_http_cookie_list_t *php_http_cookie_list_from_struct(php_http_cookie_list_t zend_string_release(lstr); } } - if ((tmp = zend_hash_str_find(ht, ZEND_STRL("max-age")))) { + if ((tmp = zend_hash_str_find_ind(ht, ZEND_STRL("max-age")))) { if (Z_TYPE_P(tmp) == IS_LONG) { list->max_age = Z_LVAL_P(tmp); } else { @@ -274,13 +274,13 @@ php_http_cookie_list_t *php_http_cookie_list_from_struct(php_http_cookie_list_t zend_string_release(lstr); } } - if ((tmp = zend_hash_str_find(ht, ZEND_STRL("path")))) { + if ((tmp = zend_hash_str_find_ind(ht, ZEND_STRL("path")))) { zend_string *str = zval_get_string(tmp); list->path = estrndup(str->val, str->len); zend_string_release(str); } - if ((tmp = zend_hash_str_find(ht, ZEND_STRL("domain")))) { + if ((tmp = zend_hash_str_find_ind(ht, ZEND_STRL("domain")))) { zend_string *str = zval_get_string(tmp); list->domain = estrndup(str->val, str->len); @@ -382,7 +382,7 @@ php_http_cookie_object_t *php_http_cookie_object_new_ex(zend_class_entry *ce, ph ce = php_http_cookie_class_entry; } - o = ecalloc(sizeof(*o) + sizeof(zval) * (ce->default_properties_count - 1), 1); + o = ecalloc(1, sizeof(*o) + zend_object_properties_size(ce)); zend_object_std_init(&o->zo, ce); object_properties_init(&o->zo, ce); o->zo.handlers = &php_http_cookie_object_handlers;