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 {
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 {
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);
zval *data_ptr;
HashTable *ht = HASH_OF(value);
- ZEND_HASH_FOREACH_VAL(ht, data_ptr)
+ ZEND_HASH_FOREACH_VAL_IND(ht, data_ptr)
{
if (SUCCESS != php_http_env_set_response_header_value(http_code, name_str, name_len, data_ptr, first)) {
return FAILURE;
switch (Z_TYPE_P(params)) {
case IS_ARRAY:
case IS_OBJECT:
- if (!(tmp = zend_hash_str_find(HASH_OF(params), ZEND_STRL("flags")))) {
+ if (!(tmp = zend_hash_str_find_ind(HASH_OF(params), ZEND_STRL("flags")))) {
break;
}
/* no break */
if (!ZEND_HASH_GET_APPLY_COUNT(fields)) {
ZEND_HASH_INC_APPLY_COUNT(fields);
- ZEND_HASH_FOREACH_KEY_VAL(fields, key.h, key.key, val)
+ ZEND_HASH_FOREACH_KEY_VAL_IND(fields, key.h, key.key, val)
{
char *str = format_key(&key, name);
if (!ZEND_HASH_GET_APPLY_COUNT(files)) {
ZEND_HASH_INC_APPLY_COUNT(files);
- ZEND_HASH_FOREACH_KEY_VAL(files, key.h, key.key, val)
+ ZEND_HASH_FOREACH_KEY_VAL_IND(files, key.h, key.key, val)
{
if (Z_TYPE_P(val) == IS_ARRAY || Z_TYPE_P(val) == IS_OBJECT) {
char *str = format_key(&key, name);
php_http_buffer_init(&prefix);
php_http_buffer_append(&prefix, keybuf->data, keybuf->used);
- ZEND_HASH_FOREACH_KEY_VAL(ht, key.h, key.key, val)
+ ZEND_HASH_FOREACH_KEY_VAL_IND(ht, key.h, key.key, val)
{
if (key.key && !*key.key->val) {
/* only public properties */
(int) (key.key->len > INT_MAX ? INT_MAX : key.key->len), key.key->val);
php_http_arrkey_dtor(&key);
+ if (Z_TYPE_P(zdata) == IS_INDIRECT) {
+ zdata = Z_INDIRECT_P(zdata);
+ }
zs = zval_get_string(zdata);
ZVAL_STR(&tmp, zs);
prepare_value(flags | PHP_HTTP_PARAMS_URLENCODED, &tmp);
if (!rfc5987) {
shift_key(buf, key_str, key_len, ass, asl, flags);
}
- ZEND_HASH_FOREACH_KEY_VAL(ht, key.h, key.key, val)
+ ZEND_HASH_FOREACH_KEY_VAL_IND(ht, key.h, key.key, val)
{
/* did you mean recursion? */
php_http_arrkey_stringify(&key, NULL);
ht = Z_ARRVAL(zv);
}
- ZEND_HASH_FOREACH_KEY_VAL(ht, key.h, key.key, params_entry)
+ ZEND_HASH_FOREACH_KEY_VAL_IND(ht, key.h, key.key, params_entry)
{
/* only public properties */
if (!key.key || *key.key->val) {
php_http_buffer_account(&buf, sizeof(php_http_url_t));
memset(buf.data, 0, buf.used);
- if ((e = zend_hash_str_find(ht, ZEND_STRL("scheme")))) {
+ if ((e = zend_hash_str_find_ind(ht, ZEND_STRL("scheme")))) {
zend_string *zs = zval_get_string(e);
url(buf)->scheme = &buf.data[buf.used];
php_http_buffer_append(&buf, zs->val, zs->len + 1);
zend_string_release(zs);
}
- if ((e = zend_hash_str_find(ht, ZEND_STRL("user")))) {
+ if ((e = zend_hash_str_find_ind(ht, ZEND_STRL("user")))) {
zend_string *zs = zval_get_string(e);
url(buf)->user = &buf.data[buf.used];
php_http_buffer_append(&buf, zs->val, zs->len + 1);
zend_string_release(zs);
}
- if ((e = zend_hash_str_find(ht, ZEND_STRL("pass")))) {
+ if ((e = zend_hash_str_find_ind(ht, ZEND_STRL("pass")))) {
zend_string *zs = zval_get_string(e);
url(buf)->pass = &buf.data[buf.used];
php_http_buffer_append(&buf, zs->val, zs->len + 1);
zend_string_release(zs);
}
- if ((e = zend_hash_str_find(ht, ZEND_STRL("host")))) {
+ if ((e = zend_hash_str_find_ind(ht, ZEND_STRL("host")))) {
zend_string *zs = zval_get_string(e);
url(buf)->host = &buf.data[buf.used];
php_http_buffer_append(&buf, zs->val, zs->len + 1);
zend_string_release(zs);
}
- if ((e = zend_hash_str_find(ht, ZEND_STRL("port")))) {
+ if ((e = zend_hash_str_find_ind(ht, ZEND_STRL("port")))) {
url(buf)->port = (unsigned short) zval_get_long(e);
}
- if ((e = zend_hash_str_find(ht, ZEND_STRL("path")))) {
+ if ((e = zend_hash_str_find_ind(ht, ZEND_STRL("path")))) {
zend_string *zs = zval_get_string(e);
url(buf)->path = &buf.data[buf.used];
php_http_buffer_append(&buf, zs->val, zs->len + 1);
zend_string_release(zs);
}
- if ((e = zend_hash_str_find(ht, ZEND_STRL("query")))) {
+ if ((e = zend_hash_str_find_ind(ht, ZEND_STRL("query")))) {
zend_string *zs = zval_get_string(e);
url(buf)->query = &buf.data[buf.used];
php_http_buffer_append(&buf, zs->val, zs->len + 1);
zend_string_release(zs);
}
- if ((e = zend_hash_str_find(ht, ZEND_STRL("fragment")))) {
+ if ((e = zend_hash_str_find_ind(ht, ZEND_STRL("fragment")))) {
zend_string *zs = zval_get_string(e);
url(buf)->fragment = &buf.data[buf.used];
php_http_buffer_append(&buf, zs->val, zs->len + 1);