summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThies C. Arntzen <thies@php.net>2000-02-12 17:37:11 +0000
committerThies C. Arntzen <thies@php.net>2000-02-12 17:37:11 +0000
commit829f4f334b622571f009c992fe5028bac2429284 (patch)
treed709182bbd0210a29a5c3d86be0f142357acc999
parente781caf962c058e71ea034433301b6511f4713cb (diff)
downloadphp-git-829f4f334b622571f009c992fe5028bac2429284.tar.gz
@- Workaround for bogus POST-Data from IE/Mac. (Thies)
@ Patch by Alain Malek <alain@virtua.ch> fix #2944
-rw-r--r--main/rfc1867.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 459d65d7ea..e9c430c1e5 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -37,6 +37,7 @@ static void php_mime_split(char *buf, int cnt, char *boundary)
{
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;
@@ -64,8 +65,13 @@ static void php_mime_split(char *buf, int cnt, char *boundary)
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;