- HashPosition pos;
- zval **rr, **rb, **re;
-
- FOREACH_VAL(pos, val, rr) {
- if (Z_TYPE_PP(rr) == IS_ARRAY) {
- if (2 == php_http_array_list(Z_ARRVAL_PP(rr) TSRMLS_CC, 2, &rb, &re)) {
- if ( ((Z_TYPE_PP(rb) == IS_LONG) || ((Z_TYPE_PP(rb) == IS_STRING) && is_numeric_string(Z_STRVAL_PP(rb), Z_STRLEN_PP(rb), NULL, NULL, 1))) &&
- ((Z_TYPE_PP(re) == IS_LONG) || ((Z_TYPE_PP(re) == IS_STRING) && is_numeric_string(Z_STRVAL_PP(re), Z_STRLEN_PP(re), NULL, NULL, 1)))) {
- zval *rbl = php_http_ztyp(IS_LONG, *rb);
- zval *rel = php_http_ztyp(IS_LONG, *re);
-
- if ((Z_LVAL_P(rbl) >= 0) && (Z_LVAL_P(rel) >= 0)) {
- php_http_buffer_appendf(&curl->options.ranges, "%ld-%ld,", Z_LVAL_P(rbl), Z_LVAL_P(rel));
+ zval *rr, *rb, *re;
+ zend_long rbl, rel;
+ HashTable *ht = HASH_OF(val);
+
+ ZEND_HASH_FOREACH_VAL(ht, rr)
+ {
+ if (Z_TYPE_P(rr) == IS_ARRAY) {
+ if (2 == php_http_array_list(Z_ARRVAL_P(rr), 2, &rb, &re)) {
+ if ( ((Z_TYPE_P(rb) == IS_LONG) || ((Z_TYPE_P(rb) == IS_STRING) && is_numeric_string(Z_STRVAL_P(rb), Z_STRLEN_P(rb), &rbl, NULL, 1))) &&
+ ((Z_TYPE_P(re) == IS_LONG) || ((Z_TYPE_P(re) == IS_STRING) && is_numeric_string(Z_STRVAL_P(re), Z_STRLEN_P(re), &rel, NULL, 1)))) {
+ if ((rbl >= 0) && (rel >= 0)) {
+ php_http_buffer_appendf(&curl->options.ranges, "%ld-%ld,", rbl, rel);