cvs: php4 /main rfc1867.c
| From: | Stanislav Malyshev | Date: | Sun, 30 Jul 2000 11:22:18 +0000 |
| Subject: | cvs: php4 /main rfc1867.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-988@lists.php.net to get a copy of this message | ||
stas Sun Jul 30 04:22:18 2000 EDT
Modified files:
/php4/main rfc1867.c
Log:
Fix file upload types array handling (#5836)
Index: php4/main/rfc1867.c
diff -u php4/main/rfc1867.c:1.36 php4/main/rfc1867.c:1.37
--- php4/main/rfc1867.c:1.36 Sat Jun 3 22:46:28 2000
+++ php4/main/rfc1867.c Sun Jul 30 04:22:18 2000
@@ -15,7 +15,7 @@
| Authors: Rasmus Lerdorf <rasmus@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.36 2000/06/04 05:46:28 rasmus Exp $ */
+/* $Id: rfc1867.c,v 1.37 2000/07/30 11:22:18 stas Exp $ */
#include <stdio.h>
#include "php.h"
@@ -195,30 +195,33 @@
}
state = 3;
+ s = "";
if ((loc2 - loc) > 2) {
if (!strncasecmp(loc + 1, "Content-Type:", 13)) {
*(loc2 - 1) = '\0';
-
- /* Add $foo_type */
- if (is_arr_upload) {
- sprintf(lbuf, "%s_type[%s]", abuf, arr_index);
- } else {
- sprintf(lbuf, "%s_type", namebuf);
- }
- php_register_variable(lbuf, loc+15, NULL ELS_CC PLS_CC);
-
- /* Add $foo[type] */
- if (is_arr_upload) {
- sprintf(lbuf, "%s[type][%s]", abuf, arr_index);
- } else {
- sprintf(lbuf, "%s[type]", namebuf);
- }
- register_http_post_files_variable(lbuf, loc+15, http_post_files ELS_CC PLS_CC);
-
- *(loc2 - 1) = '\n';
+ s = loc+15;
}
rem -= 2;
ptr += 2;
+ }
+
+ /* Add $foo_type */
+ if (is_arr_upload) {
+ sprintf(lbuf, "%s_type[%s]", abuf, arr_index);
+ } else {
+ sprintf(lbuf, "%s_type", namebuf);
+ }
+ php_register_variable(lbuf, s, NULL ELS_CC PLS_CC);
+
+ /* Add $foo[type] */
+ if (is_arr_upload) {
+ sprintf(lbuf, "%s[type][%s]", abuf, arr_index);
+ } else {
+ sprintf(lbuf, "%s[type]", namebuf);
+ }
+ register_http_post_files_variable(lbuf, s, http_post_files ELS_CC PLS_CC);
+ if(*s != '\0') {
+ *(loc2 - 1) = '\n';
}
}
break;