| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
- | Copyright (c) 2004-2007, Michael Wallner <mike@php.net> |
+ | Copyright (c) 2004-2010, Michael Wallner <mike@php.net> |
+--------------------------------------------------------------------+
*/
list->flags = (long) Z_DVAL_PP(tmp);
break;
case IS_STRING:
- cpy = *tmp;
- convert_to_long_ex(&cpy);
- list->flags = Z_LVAL_PP(tmp);
- if (cpy != *tmp) {
- zval_ptr_dtor(&cpy);
- }
+ cpy = http_zsep(IS_LONG, *tmp);
+ list->flags = Z_LVAL_P(cpy);
+ zval_ptr_dtor(&cpy);
break;
default:
break;
list->expires = (long) Z_DVAL_PP(tmp);
break;
case IS_STRING:
- cpy = *tmp;
- convert_to_long_ex(&cpy);
+ cpy = http_zsep(IS_LONG, *tmp);
if (Z_LVAL_P(cpy)) {
list->expires = Z_LVAL_P(cpy);
} else {
list->expires = expires;
}
}
- if (cpy != *tmp) {
- zval_ptr_dtor(&cpy);
- }
+ zval_ptr_dtor(&cpy);
break;
default:
break;
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));
+ zval *tmp = http_zsep(IS_STRING, *val);
+ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
+ zval_ptr_dtor(&tmp);
}
}
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));
+ zval *tmp = http_zsep(IS_STRING, *val);
+ append_encoded(&buf, key.str, key.len-1, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
}
}