]> granicus.if.org Git - php/commitdiff
Fix #66562: Consistency bug where curl_multi_getcontent behaves different from curl_exec
authorFreek <freek.lijten@procurios.nl>
Tue, 28 Jan 2014 10:47:14 +0000 (11:47 +0100)
committerStanislav Malyshev <stas@php.net>
Mon, 14 Apr 2014 01:12:17 +0000 (18:12 -0700)
curl_exec returns an empty string when data is received from a domain that returns zero content. curl_multi_getcontent
returned null. Now it returns an empty string fixing the incosistency

NEWS
ext/curl/multi.c

diff --git a/NEWS b/NEWS
index a059e075f2df2799224b3111b5d12df4067a09ba..c6522aea91d7f3f2c86e85c1c3227b639a5e939d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,10 @@ PHP                                                                        NEWS
   . Fixed bug #67024 (getimagesize should recognize BMP files with negative 
     height). (Gabor Buella)
 
+- cURL:
+  . Fixed bug #66562 (curl_exec returns differently than curl_multi_getcontent).
+    (Freek Lijten)
+
 - Date:
   . Fixed bug #66721 (__wakeup of DateTime segfaults when invalid object data is
     supplied). (Boro Sitnikovski)
index a990dad2f2f1a6a92a36c6b9a4720b6d7e0a26ff..c0985e564635a0921b857c28bc1485e7ea154be0 100644 (file)
@@ -253,6 +253,8 @@ PHP_FUNCTION(curl_multi_getcontent)
                smart_str_0(&ch->handlers->write->buf);
                RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
        }
+
+        RETURN_EMPTY_STRING();
 }
 /* }}} */