missed that part
authorMichael Wallner <mike@php.net>
Thu, 22 Dec 2005 09:12:06 +0000 (09:12 +0000)
committerMichael Wallner <mike@php.net>
Thu, 22 Dec 2005 09:12:06 +0000 (09:12 +0000)
http_request_object.c

index 7706fd7ef1cd45df6c46532d464d707c41973a9a..5d02c3e7f862b8dee04bd611fc6f8b34db1eaf6b 100644 (file)
@@ -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);