summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJille Timmermans <jille@quis.cx>2014-07-17 17:21:52 +0200
committerJille Timmermans <jille@quis.cx>2014-07-17 17:21:52 +0200
commitacd0d7b4037de9498ee5686b90b349342db08f4c (patch)
tree96a832568d649bd34ef2f077df760091e62c8afa
parent81c42db7b7799ea0826fe0dfb5ba399509a9affb (diff)
downloadphp-git-acd0d7b4037de9498ee5686b90b349342db08f4c.tar.gz
Fixed bug #67643 (curl_multi_getcontent returns '' when CURLOPT_RETURNTRANSFER isn't set)
-rw-r--r--NEWS3
-rw-r--r--ext/curl/multi.c7
2 files changed, 8 insertions, 2 deletions
diff --git a/NEWS b/NEWS
index 1badfb8579..6267baf773 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@ PHP NEWS
(Adam)
. Update the MIME type list from the one shipped by Apache HTTPD. (Adam)
+- cURL:
+ . Fixed bug #67643 (curl_multi_getcontent returns '' when CURLOPT_RETURNTRANSFER isn't set). (Jille Timmermans)
+
- DBA:
. Fixed bug #62490 (dba_delete returns true on missing item (inifile)). (Mike)
diff --git a/ext/curl/multi.c b/ext/curl/multi.c
index 9fbea5518f..0c21fe1b54 100644
--- a/ext/curl/multi.c
+++ b/ext/curl/multi.c
@@ -244,12 +244,15 @@ PHP_FUNCTION(curl_multi_getcontent)
ZEND_FETCH_RESOURCE(ch, php_curl *, &z_ch, -1, le_curl_name, le_curl);
- if (ch->handlers->write->method == PHP_CURL_RETURN && ch->handlers->write->buf.len > 0) {
+ if (ch->handlers->write->method == PHP_CURL_RETURN) {
+ if (ch->handlers->write->buf.len == 0) {
+ RETURN_EMPTY_STRING();
+ }
smart_str_0(&ch->handlers->write->buf);
RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 1);
}
- RETURN_EMPTY_STRING();
+ RETURN_NULL();
}
/* }}} */