- CURL:
. Implemented FR #77711 (CURLFile should support UNICODE filenames). (cmb)
+ . Fixed bug #79033 (Curl timeout error with specific url and post). (cmb)
- Fileinfo:
. Fixed bug #74170 (locale information change after mime_content_type).
zend_string *string_key;
zend_ulong num_key;
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
- curl_mime *mime;
+ curl_mime *mime = NULL;
curl_mimepart *part;
CURLcode form_error;
#else
}
#if LIBCURL_VERSION_NUM >= 0x073800 /* 7.56.0 */
- mime = curl_mime_init(ch->cp);
- if (mime == NULL) {
- return FAILURE;
+ if (zend_hash_num_elements(postfields) > 0) {
+ mime = curl_mime_init(ch->cp);
+ if (mime == NULL) {
+ return FAILURE;
+ }
}
#endif
--- /dev/null
+--TEST--
+Bug #79033 (Curl timeout error with specific url and post)
+--SKIPIF--
+<?php include 'skipif.inc'; ?>
+--FILE--
+<?php
+include 'server.inc';
+$host = curl_cli_server_start();
+$ch = curl_init();
+curl_setopt_array($ch, [
+ CURLOPT_URL => "{$host}/get.inc?test=post",
+ CURLOPT_POST => true,
+ CURLOPT_POSTFIELDS => [],
+ CURLINFO_HEADER_OUT => true,
+ CURLOPT_RETURNTRANSFER => true,
+]);
+var_dump(curl_exec($ch));
+var_dump(curl_getinfo($ch)["request_header"]);
+?>
+--EXPECTF--
+string(%d) "array(0) {
+}
+"
+string(90) "POST /get.inc?test=post HTTP/1.1
+Host: localhost:%d
+Accept: */*
+Content-Length: 0
+
+"