diff --git a/NEWS b/NEWS index 0c80ffefb1b2..5779a0a0a545 100644 --- a/NEWS +++ b/NEWS @@ -27,6 +27,10 @@ PHP NEWS so an in-process engine restart keeps growing the map_ptr table). (David Carlier) +- Curl: + . Fixed curl_setopt() ignoring errors while building multipart POST fields. + (Ilia Alshanetsky) + - Date: . Fixed bug GH-20503 (Assertion failure with ext/date DateInterval property hash construction). (heathdutton) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 8f82bd7f285d..5f811d090c95 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1574,14 +1574,18 @@ static inline zend_result build_mime_structure_from_hash(php_curl *ch, zval *zpo zval *current_element; ZEND_HASH_FOREACH_VAL(HASH_OF(current), current_element) { - add_simple_field(mime, string_key, current_element); + if ((form_error = add_simple_field(mime, string_key, current_element)) != CURLE_OK && error == CURLE_OK) { + error = form_error; + } } ZEND_HASH_FOREACH_END(); zend_string_release_ex(string_key, 0); continue; } - add_simple_field(mime, string_key, current); + if ((form_error = add_simple_field(mime, string_key, current)) != CURLE_OK && error == CURLE_OK) { + error = form_error; + } zend_string_release_ex(string_key, 0); } ZEND_HASH_FOREACH_END();