diff options
author | Zeev Suraski <zeev@php.net> | 2000-09-08 21:56:47 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-09-08 21:56:47 +0000 |
commit | 75086e3088ab06fbb2415e15490c216ac7c9c8b9 (patch) | |
tree | bb527e738a99e27af7778d80e5c1c0eb61d9f4de /main/rfc1867.c | |
parent | 9a4c654606c28d43458f91212d11f19743142f44 (diff) | |
download | php-git-75086e3088ab06fbb2415e15490c216ac7c9c8b9.tar.gz |
- Implemented is_upload_file()
Diffstat (limited to 'main/rfc1867.c')
-rw-r--r-- | main/rfc1867.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/main/rfc1867.c b/main/rfc1867.c index bdff72a2b6..68af24557c 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -86,7 +86,7 @@ static void register_http_post_files_variable_ex(char *var, zval *val, zval *htt /* * Split raw mime stream up into appropriate components */ -static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr) +static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr SLS_DC) { char *ptr, *loc, *loc2, *loc3, *s, *name, *filename, *u, *fn; int len, state = 0, Done = 0, rem, urem; @@ -102,6 +102,9 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr) zend_hash_init(&PG(rfc1867_protected_variables), 5, NULL, NULL, 0); + ALLOC_HASHTABLE(SG(rfc1867_uploaded_files)); + zend_hash_init(SG(rfc1867_uploaded_files), 5, NULL, NULL, 0); + ALLOC_ZVAL(http_post_files); array_init(http_post_files); INIT_PZVAL(http_post_files); @@ -348,6 +351,11 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr) } add_protected_variable(namebuf PLS_CC); safe_php_register_variable(namebuf, fn, NULL, 1 ELS_CC PLS_CC); + { + int dummy=1; + + zend_hash_add(SG(rfc1867_uploaded_files), namebuf, strlen(namebuf)+1, &dummy, sizeof(int), NULL); + } /* Add $foo[tmp_name] */ if(is_arr_upload) { @@ -404,7 +412,7 @@ SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) boundary_len = strlen(boundary); if (SG(request_info).post_data) { - php_mime_split(SG(request_info).post_data, SG(request_info).post_data_length, boundary, array_ptr); + php_mime_split(SG(request_info).post_data, SG(request_info).post_data_length, boundary, array_ptr SLS_CC); } } |