X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=php_http_env_request.c;h=6aff0c00fe0d106fba418841e061efc02bb7778d;hp=01c2f6daaeef45a3d5055295ec36fbc56976fa9c;hb=d7f91cdeb926694858b07d77e29e10d5617112b1;hpb=87db9817d428282792c8146d9c2ae9748ebf6f1e diff --git a/php_http_env_request.c b/php_http_env_request.c index 01c2f6d..6aff0c0 100644 --- a/php_http_env_request.c +++ b/php_http_env_request.c @@ -6,7 +6,7 @@ | modification, are permitted provided that the conditions mentioned | | in the accompanying LICENSE file are met. | +--------------------------------------------------------------------+ - | Copyright (c) 2004-2013, Michael Wallner | + | Copyright (c) 2004-2014, Michael Wallner | +--------------------------------------------------------------------+ */ @@ -96,7 +96,11 @@ static int grab_files(void *zpp TSRMLS_DC, int argc, va_list argv, zend_hash_key add_assoc_zval_ex(cpy, ZEND_STRS("file"), *tmp); zend_hash_del_key_or_index(Z_ARRVAL_P(cpy), ZEND_STRS("tmp_name"), 0, HASH_DEL_KEY); } - zend_hash_quick_update(Z_ARRVAL_P(zfiles), key->arKey, key->nKeyLength, key->h, (void *) &cpy, sizeof(zval *), NULL); + if (key->nKeyLength > 0) { + zend_hash_quick_update(Z_ARRVAL_P(zfiles), key->arKey, key->nKeyLength, key->h, (void *) &cpy, sizeof(zval *), NULL); + } else { + zend_hash_index_update(Z_ARRVAL_P(zfiles), key->h, (void *) &cpy, sizeof(zval *), NULL); + } } }