[PHP-DEV] fix for bug 2944 From: Alain Malek (alain <email protected>)
Date: 01/31/00

Hello there,

First a big thanks for developing such a cool tool like php :)

I just came across the same problem as the one described in bug id #2944
which produces the following warning on IE/MAC:
Upload Mime headers garbled [onten] in ....

I did a tcpdump of the request sent by IE4.5 on Mac.
Each line of the request ends with 0x0d 0x0a as expected,
except for the mime boundary for form-data of graphical submit button.
In this case the boundary ends with a single 0x0a.
I think this is a bug in MSIE for Mac.
Here is a work around. (I'm actually using PHP4 beta3)

Alain Malek

--- php-4.0b3/rfc1867.c Fri Oct 15 17:22:20 1999
+++ php-4/rfc1867.c Mon Jan 31 20:22:00 2000
@@ -36,6 +36,7 @@
 {
         char *ptr, *loc, *loc2, *s, *name, *filename, *u, *fn;
         int len, state = 0, Done = 0, rem, urem;
+ int eolsize;
         long bytes, max_file_size = 0;
         char *namebuf=NULL, *filenamebuf=NULL, *lbuf=NULL;
         FILE *fp;
@@ -63,8 +64,13 @@
                                         if (!strncmp(loc, boundary, len)) {
 
                                                 state = 1;
- rem -= (loc - ptr) + len + 2;
- ptr = loc + len + 2;
+
+ eolsize = 2;
+ if(*(loc+len)==0x0a)
+ eolsize = 1;
+
+ rem -= (loc - ptr) + len + eolsize;
+ ptr = loc + len + eolsize;
                                         } else {
                                                 rem -= (loc - ptr) + 1;
                                                 ptr = loc + 1;

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>