summaryrefslogtreecommitdiff
path: root/ext/curl/interface.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2019-12-28 10:47:52 +0100
committerChristoph M. Becker <cmbecker69@gmx.de>2019-12-28 10:48:59 +0100
commit6d1dff6f3d64844bdb60ba65f64a4d1a5c47ee6c (patch)
tree0e06c9504a7637dfd830cceb38fc503b05f602fd /ext/curl/interface.c
parent32cd373dfd4e5b5710929c534f960694853a02e0 (diff)
parentc47b18a222ceb1d78810d2822170cbf6e110a98c (diff)
downloadphp-git-6d1dff6f3d64844bdb60ba65f64a4d1a5c47ee6c.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #79033: Curl timeout error with specific url and post
Diffstat (limited to 'ext/curl/interface.c')
-rw-r--r--ext/curl/interface.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/curl/interface.c b/ext/curl/interface.c
index 6a25359597..39d74b27d1 100644
--- a/ext/curl/interface.c
+++ b/ext/curl/interface.c
@@ -2754,7 +2754,7 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
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
@@ -2769,9 +2769,11 @@ static int _php_curl_setopt(php_curl *ch, zend_long option, zval *zvalue) /* {{{
}
#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