]> granicus.if.org Git - php/commitdiff
MFB: Fixed bug #47217 (content-type is not set properly for file uploads)
authorIlia Alshanetsky <iliaa@php.net>
Mon, 26 Jan 2009 15:25:25 +0000 (15:25 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 26 Jan 2009 15:25:25 +0000 (15:25 +0000)
NEWS
ext/curl/interface.c

diff --git a/NEWS b/NEWS
index fed548ec6e215313028f6183426af68c8ee70923..1d92e2f6728b492af8581f95ea66a3fe8a1f01f4 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ PHP                                                                        NEWS
 - Fixed bug in xml_error_string() which resulted in messages being
   off by one. (Scott)
 
+- Fixed bug #47217 (content-type is not set properly for file uploads).
+  (Ilia)
 - Fixed bug #47174 (base64_decode() interprets pad char in mid string as
   terminator). (Ilia)
 - Fixed bug #47165 (Possible memory corruption when passing return value by
index 600935722eab3c9d5a0c10dc8c48a220b1289217..01145658307016f483fd318e87f7943b90ef12e3 100644 (file)
@@ -1513,14 +1513,13 @@ static int _php_curl_setopt(php_curl *ch, long option, zval **zvalue, zval *retu
                                                        return 1;
                                                }
                                                if (type) {
-                                                       type++;
                                                        error = curl_formadd(&first, &last, 
                                                                                         CURLFORM_COPYNAME, string_key,
                                                                                         CURLFORM_NAMELENGTH, (long)string_key_len - 1,
                                                                                         CURLFORM_FILE, postval,
-                                                                                        CURLFORM_CONTENTTYPE, type,
+                                                                                        CURLFORM_CONTENTTYPE, type + sizeof(";type=") - 1,
                                                                                         CURLFORM_END);
-                                                       *(type - 1) = ';';
+                                                       *type = ';';
                                                } else {
                                                        error = curl_formadd(&first, &last, 
                                                                                         CURLFORM_COPYNAME, string_key,