cvs: php4 /main rfc1867.c
| From: | Ilia Alshanetsky | Date: | Sat, 07 Dec 2002 00:48:13 +0000 |
| Subject: | cvs: php4 /main rfc1867.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-16986@lists.php.net to get a copy of this message | ||
iliaa Fri Dec 6 19:48:13 2002 EDT
Modified files:
/php4/main rfc1867.c
Log:
Fixed bugs #20725 & #20860. Post form variables get lost if the uploaded
files cannot be written to disk.
Index: php4/main/rfc1867.c
diff -u php4/main/rfc1867.c:1.124 php4/main/rfc1867.c:1.125
--- php4/main/rfc1867.c:1.124 Fri Nov 22 14:34:17 2002
+++ php4/main/rfc1867.c Fri Dec 6 19:48:13 2002
@@ -16,7 +16,7 @@
| Jani Taskinen <sniper@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.124 2002/11/22 19:34:17 sesser Exp $ */
+/* $Id: rfc1867.c,v 1.125 2002/12/07 00:48:13 iliaa Exp $ */
/*
* This product includes software developed by the Apache Group
@@ -686,7 +686,7 @@
{
char *boundary, *s=NULL, *boundary_end = NULL, *start_arr=NULL, *array_index=NULL;
char *temp_filename=NULL, *lbuf=NULL, *abuf=NULL;
- int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0, max_file_size=0;
+ int boundary_len=0, total_bytes=0, cancel_upload=0, is_arr_upload=0, array_len=0, max_file_size=0,
skip_upload=0;
zval *http_post_files=NULL;
zend_bool magic_quotes_gpc;
multipart_buffer *mbuff;
@@ -831,14 +831,23 @@
SAFE_RETURN;
}
- /* Handle file */
- fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename TSRMLS_CC);
- if (!fp) {
- efree(param);
- efree(filename);
- sapi_module.sapi_error(E_WARNING, "File upload error - unable to create a temporary
file");
- SAFE_RETURN;
+ if (!skip_upload) {
+ /* Handle file */
+ fp = php_open_temporary_file(PG(upload_tmp_dir), "php", &temp_filename
TSRMLS_CC);
+ if (!fp) {
+ sapi_module.sapi_error(E_WARNING, "File upload error - unable to create a temporary
file");
+ skip_upload = 1;
+ }
}
+ if (skip_upload) {
+ if (param) {
+ efree(param);
+ }
+ if (filename) {
+ efree(filename);
+ }
+ continue;
+ }
total_bytes = 0;
cancel_upload = 0;