From e8f984d77a14c0e5dfd854f7c7865037b83cf03d Mon Sep 17 00:00:00 2001 From: Sterling Hughes Date: Thu, 1 Jul 2004 06:50:46 +0000 Subject: [PATCH] fix bug wrt to CURLOPT_POSTFIELDS where if you passed it code like: $fields = array('foo' => 'bar'); curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); curl_exec($ch); as opposed to : curl_setopt($ch, CURLOPT_POSTFIELDS, array('foo' => 'bar')); you'll get a segv or no results, depending on the mood and cycle of the moon. --- ext/curl/interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 4c296dc54c..a3a67a585d 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1084,7 +1084,7 @@ PHP_FUNCTION(curl_setopt) error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key, CURLFORM_NAMELENGTH, string_key_len - 1, - (ZVAL_REFCOUNT(*zvalue) > 1 ? CURLFORM_PTRCONTENTS : CURLFORM_COPYCONTENTS), postval, + CURLFORM_COPYCONTENTS, postval, CURLFORM_CONTENTSLENGTH, Z_STRLEN_PP(current), CURLFORM_END); } -- 2.40.0