X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=php_http_env.c;h=af0039473eeb02e0e0b96da14857eabee55b3090;hb=40a6a12edc42c8b830f7251b4b9eebef62f047fc;hp=eef0c37aad541fb1d64ce933d13fd63a3ff2f19c;hpb=c51b7204d895c33124de9799fdbe16eb7bb8158d;p=m6w6%2Fext-http diff --git a/php_http_env.c b/php_http_env.c index eef0c37..af00394 100644 --- a/php_http_env.c +++ b/php_http_env.c @@ -530,7 +530,7 @@ ZEND_RESULT_CODE php_http_env_set_response_header_value(long http_code, const ch 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; @@ -957,18 +957,10 @@ static SAPI_POST_HANDLER_FUNC(php_http_json_post_handler) ZVAL_NULL(&tmp); php_json_decode(&tmp, json->val, json->len, 1, PG(max_input_nesting_level)); - switch (Z_TYPE(tmp)) { - case IS_NULL: - break; - - case IS_ARRAY: + if (Z_TYPE(tmp) == IS_ARRAY) { array_copy(Z_ARRVAL(tmp), Z_ARRVAL_P(zarg)); - zval_ptr_dtor(&tmp); - break; - - default: - ZVAL_COPY_VALUE(zarg, &tmp); } + zval_ptr_dtor(&tmp); } zend_string_release(json); }