From: Michael Wallner Date: Thu, 22 Dec 2005 09:12:06 +0000 (+0000) Subject: missed that part X-Git-Tag: RELEASE_0_21_0~48 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=8fa713be4960d51958523429ee0e7dfca6d017fb;p=m6w6%2Fext-http missed that part --- diff --git a/http_request_object.c b/http_request_object.c index 7706fd7..5d02c3e 100644 --- a/http_request_object.c +++ b/http_request_object.c @@ -1386,24 +1386,17 @@ PHP_METHOD(HttpRequest, addPostFile) */ PHP_METHOD(HttpRequest, setPostFiles) { - zval *files, *post; + zval *files = NULL, *post; getObject(http_request_object, obj); - if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &files)) { + if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a!/", &files)) { RETURN_FALSE; } - post = GET_PROP(obj, postFiles); - if (Z_TYPE_P(post) == IS_NULL) { - MAKE_STD_ZVAL(post); - array_init(post); - } else { - SEPARATE_ZVAL(&post); - } - - zend_hash_clean(Z_ARRVAL_P(post)); - if (files && zend_hash_num_elements(Z_ARRVAL_P(files))) { - array_copy(files, post); + MAKE_STD_ZVAL(post); + array_init(post); + if (files && (Z_TYPE_P(files) == IS_ARRAY)) { + array_copy(files, post) } SET_PROP(obj, postFiles, post);