From: foobar Date: Mon, 26 Jan 2004 00:16:16 +0000 (+0000) Subject: - Fixed bug #27040 (passing an array of form-fields to CURLOPT_POSTFIELDS does not... X-Git-Tag: RELEASE_1_3b6~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03e4695d3d5295fad4bd4445a53ff22cf4350d9b;p=php - Fixed bug #27040 (passing an array of form-fields to CURLOPT_POSTFIELDS does not work). --- diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 959dc159b4..c823f78ee8 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1001,7 +1001,7 @@ PHP_FUNCTION(curl_setopt) error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key, CURLFORM_NAMELENGTH, string_key_len - 1, - CURLFORM_PTRCONTENTS, postval, + (ZVAL_REFCOUNT(*zvalue) > 1 ? CURLFORM_PTRCONTENTS : CURLFORM_COPYCONTENTS), postval, CURLFORM_CONTENTSLENGTH, Z_STRLEN_PP(current), CURLFORM_END); }