| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
- | Copyright (c) 2004-2006, Michael Wallner <mike@php.net> |
+ | Copyright (c) 2004-2007, Michael Wallner <mike@php.net> |
+--------------------------------------------------------------------+
*/
if (SUCCESS == zend_hash_find(ht, "path", sizeof("path"), (void *) &tmp) && Z_TYPE_PP(tmp) == IS_STRING) {
list->path = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
- if (SUCCESS == zend_hash_find(ht, "domain", sizeof("domain"), (void *) &tmp)) {
+ if (SUCCESS == zend_hash_find(ht, "domain", sizeof("domain"), (void *) &tmp) && Z_TYPE_PP(tmp) == IS_STRING) {
list->domain = estrndup(Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));
}
{
phpstr buf;
zval **val;
- ulong idx = 0;
- uint keylen = 0;
- char *key = NULL;
+ HashKey key = initHashKey(0);
HashPosition pos;
phpstr_init(&buf);
- FOREACH_HASH_KEYLENVAL(pos, &list->cookies, key, keylen, idx, val) {
- if (key && keylen) {
- append_encoded(&buf, key, keylen-1, Z_STRVAL_PP(val), Z_STRLEN_PP(val));
- key = NULL;
+ FOREACH_HASH_KEYVAL(pos, &list->cookies, key, val) {
+ if (key.type == HASH_KEY_IS_STRING && key.len) {
+ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_PP(val), Z_STRLEN_PP(val));
}
}
efree(date);
}
- FOREACH_HASH_KEYLENVAL(pos, &list->extras, key, keylen, idx, val) {
- if (key && keylen) {
- append_encoded(&buf, key, keylen-1, Z_STRVAL_PP(val), Z_STRLEN_PP(val));
- key = NULL;
+ FOREACH_HASH_KEYVAL(pos, &list->extras, key, val) {
+ if (key.type == HASH_KEY_IS_STRING && key.len) {
+ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_PP(val), Z_STRLEN_PP(val));
}
}