| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
- | Copyright (c) 2004-2013, Michael Wallner <mike@php.net> |
+ | Copyright (c) 2004-2014, Michael Wallner <mike@php.net> |
+--------------------------------------------------------------------+
*/
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;
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);
}
}
}
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);
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);
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);
}
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);
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);
}
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);
}
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);
}