From: foobar Date: Tue, 19 Jun 2001 16:54:30 +0000 (+0000) Subject: Fix one problem with Opera browsers. Tested with IE,NS,Opera. X-Git-Tag: PRE_GRANULAR_GARBAGE_FIX~35 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0ed727aeedf8eb0f91a3f2845c18d825f65410f;p=php Fix one problem with Opera browsers. Tested with IE,NS,Opera. There can be also a \t before the 'filename=' part. --- diff --git a/main/rfc1867.c b/main/rfc1867.c index 899bfb66dd..d7a90fa792 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -220,9 +220,9 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S php_error(E_WARNING, "File upload error - no name component in content disposition"); SAFE_RETURN; } - filename = strstr(s, " filename=\""); + filename = strstr(s, "filename=\""); if (filename && filename < loc) { - filename += 11; + filename += 10; s = memchr(filename, '\"', loc - filename); if (!s) { php_error(E_WARNING, "File Upload Mime headers garbled filename: [%c%c%c%c%c]", *filename, *(filename + 1), *(filename + 2), *(filename + 3), *(filename + 4)); @@ -251,11 +251,11 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S } /* Add $foo[name] */ - if (is_arr_upload) { - sprintf(lbuf, "%s[name][%s]", abuf, arr_index); - } else { - sprintf(lbuf, "%s[name]", namebuf); - } + if (is_arr_upload) { + sprintf(lbuf, "%s[name][%s]", abuf, arr_index); + } else { + sprintf(lbuf, "%s[name]", namebuf); + } if (s && s > filenamebuf) { register_http_post_files_variable(lbuf, s+1, http_post_files, 0 ELS_CC PLS_CC); } else {