Browse Source

Fixed bug #47217 (content-type is not set properly for file uploads)

experimental/5.3-FPM
Ilia Alshanetsky 18 years ago
parent
commit
51f4e5efcd
  1. 7
      ext/curl/interface.c

7
ext/curl/interface.c

@ -379,7 +379,7 @@ PHP_MINFO_FUNCTION(curl)
#if LIBCURL_VERSION_NUM > 0x070f03 /* 7.15.4 */
{"CharConv", CURL_VERSION_CONV},
#endif
NULL, 0
{NULL, 0}
};
php_info_print_table_row(1, "Features");
@ -1626,14 +1626,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,

Loading…
Cancel
Save