X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_env_request.c;h=4da183ec6fa144ac77be4cf3569d207d37fbce82;hp=e4e8eafc5f8610d8a7997a7e6cec7ff43d7a85fb;hb=7ba90c6d9d6843549fb9227d1a7aa05033e60772;hpb=112e0617d9aa6f3043dfeb94a945b17e31b85430 diff --git a/php_http_env_request.c b/php_http_env_request.c index e4e8eaf..4da183e 100644 --- a/php_http_env_request.c +++ b/php_http_env_request.c @@ -70,7 +70,7 @@ static int grab_file(void *zpp TSRMLS_DC, int argc, va_list argv, zend_hash_key && SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(type), key->h, (void *) &ztype) && SUCCESS == zend_hash_index_find(Z_ARRVAL_PP(error), key->h, (void *) &zerror) ) { - zval *entry; + zval *entry, **array; MAKE_STD_ZVAL(entry); array_init(entry); @@ -86,7 +86,16 @@ static int grab_file(void *zpp TSRMLS_DC, int argc, va_list argv, zend_hash_key Z_ADDREF_PP(zerror); add_assoc_zval_ex(entry, ZEND_STRS("error"), *zerror); - zend_hash_quick_update(Z_ARRVAL_P(zfiles), file_key->arKey, file_key->nKeyLength, file_key->h, (void *) &entry, sizeof(zval *), NULL); + if (SUCCESS == zend_hash_quick_find(Z_ARRVAL_P(zfiles), file_key->arKey, file_key->nKeyLength, file_key->h, (void *) &array)) { + add_next_index_zval(*array, entry); + } else { + zval *tmp; + + MAKE_STD_ZVAL(tmp); + array_init(tmp); + add_next_index_zval(tmp, entry); + zend_hash_quick_update(Z_ARRVAL_P(zfiles), file_key->arKey, file_key->nKeyLength, file_key->h, (void *) &tmp, sizeof(zval *), NULL); + } } return ZEND_HASH_APPLY_KEEP;