X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_cookie.c;h=354dfa6ed4f0315aa8dbb0e43fb4062281351316;hp=1234e38708a962386a1558df575966c91fee1da6;hb=refs%2Fheads%2Fv2.3.x;hpb=87db9817d428282792c8146d9c2ae9748ebf6f1e diff --git a/php_http_cookie.c b/php_http_cookie.c index 1234e38..354dfa6 100644 --- a/php_http_cookie.c +++ b/php_http_cookie.c @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2013, Michael Wallner | + | Copyright (c) 2004-2014, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -41,8 +41,8 @@ php_http_cookie_list_t *php_http_cookie_list_copy(php_http_cookie_list_t *from, array_copy(&from->cookies, &to->cookies); array_copy(&from->extras, &to->extras); - STR_SET(to->path, from->path ? estrdup(from->path) : NULL); - STR_SET(to->domain, from->domain ? estrdup(from->domain) : NULL); + PTR_SET(to->path, from->path ? estrdup(from->path) : NULL); + PTR_SET(to->domain, from->domain ? estrdup(from->domain) : NULL); to->expires = from->expires; to->max_age = from->max_age; to->flags = from->flags; @@ -56,8 +56,8 @@ void php_http_cookie_list_dtor(php_http_cookie_list_t *list) zend_hash_destroy(&list->cookies); zend_hash_destroy(&list->extras); - STR_SET(list->path, NULL); - STR_SET(list->domain, NULL); + PTR_SET(list->path, NULL); + PTR_SET(list->domain, NULL); } } @@ -125,9 +125,9 @@ static void add_entry(php_http_cookie_list_t *list, char **allowed_extras, long } if _KEY_IS("path") { - STR_SET(list->path, estrndup(Z_STRVAL_P(arg), Z_STRLEN_P(arg))); + PTR_SET(list->path, estrndup(Z_STRVAL_P(arg), Z_STRLEN_P(arg))); } else if _KEY_IS("domain") { - STR_SET(list->domain, estrndup(Z_STRVAL_P(arg), Z_STRLEN_P(arg))); + PTR_SET(list->domain, estrndup(Z_STRVAL_P(arg), Z_STRLEN_P(arg))); } else if _KEY_IS("expires") { char *date = estrndup(Z_STRVAL_P(arg), Z_STRLEN_P(arg)); list->expires = php_parse_date(date, NULL); @@ -526,7 +526,7 @@ static PHP_METHOD(HttpCookie, setCookies) zend_hash_clean(&obj->list->cookies); if (cookies) { - array_copy(cookies, &obj->list->cookies); + array_copy_strings(cookies, &obj->list->cookies); } RETVAL_ZVAL(getThis(), 1, 0); @@ -546,7 +546,7 @@ static PHP_METHOD(HttpCookie, addCookies) PHP_HTTP_COOKIE_OBJECT_INIT(obj); - array_join(cookies, &obj->list->cookies, 1, ARRAY_JOIN_STRONLY); + array_join(cookies, &obj->list->cookies, 1, ARRAY_JOIN_STRONLY|ARRAY_JOIN_STRINGIFY); RETVAL_ZVAL(getThis(), 1, 0); } @@ -585,7 +585,7 @@ static PHP_METHOD(HttpCookie, setExtras) zend_hash_clean(&obj->list->extras); if (extras) { - array_copy(extras, &obj->list->extras); + array_copy_strings(extras, &obj->list->extras); } RETVAL_ZVAL(getThis(), 1, 0); @@ -605,7 +605,7 @@ static PHP_METHOD(HttpCookie, addExtras) PHP_HTTP_COOKIE_OBJECT_INIT(obj); - array_join(extras, &obj->list->extras, 1, ARRAY_JOIN_STRONLY); + array_join(extras, &obj->list->extras, 1, ARRAY_JOIN_STRONLY|ARRAY_JOIN_STRINGIFY); RETVAL_ZVAL(getThis(), 1, 0); } @@ -782,7 +782,7 @@ static PHP_METHOD(HttpCookie, setDomain) PHP_HTTP_COOKIE_OBJECT_INIT(obj); - STR_SET(obj->list->domain, domain_str ? estrndup(domain_str, domain_len) : NULL); + PTR_SET(obj->list->domain, domain_str ? estrndup(domain_str, domain_len) : NULL); RETVAL_ZVAL(getThis(), 1, 0); } @@ -821,7 +821,7 @@ static PHP_METHOD(HttpCookie, setPath) PHP_HTTP_COOKIE_OBJECT_INIT(obj); - STR_SET(obj->list->path, path_str ? estrndup(path_str, path_len) : NULL); + PTR_SET(obj->list->path, path_str ? estrndup(path_str, path_len) : NULL); RETVAL_ZVAL(getThis(), 1, 0); }