From: Stefan Esser Date: Sun, 10 Mar 2002 11:04:20 +0000 (+0000) Subject: Fix: Now returns correct Content-Type for Opera 6.01 X-Git-Tag: php-4.2.0RC1~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d343076eef4258bff6f6ff45f0dbabe2a28a1d4;p=php Fix: Now returns correct Content-Type for Opera 6.01 --- diff --git a/main/rfc1867.c b/main/rfc1867.c index d1fcb625a6..97f7399598 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -807,12 +807,18 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) } else { register_http_post_files_variable(lbuf, filename, http_post_files, 0 TSRMLS_CC); } - s = ""; efree(filename); + s = NULL; /* Possible Content-Type: */ if (!(cd = php_mime_get_hdr_value(header, "Content-Type")) || filename == "") { cd = ""; + } else { + /* fix for Opera 6.01 */ + s = strchr(cd, ';'); + if (s != NULL) { + *s = '\0'; + } } /* Add $foo_type */ @@ -831,6 +837,12 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) } register_http_post_files_variable(lbuf, cd, http_post_files, 0 TSRMLS_CC); + /* Restore Content-Type Header */ + if (s != NULL) { + *s = ';'; + } + s = ""; + /* Initialize variables */ add_protected_variable(param TSRMLS_CC);