diff options
author | Jille Timmermans <jille@quis.cx> | 2014-07-17 17:21:52 +0200 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2014-11-30 22:18:12 -0800 |
commit | 7049d3450e25788c43c6cb3c5ddf719286569bd1 (patch) | |
tree | 2676c98ce24c4c303d89cea26b0ea7001ffc7539 | |
parent | f7eedbe9a685d6047dc04b29121980c2c6773251 (diff) | |
download | php-git-7049d3450e25788c43c6cb3c5ddf719286569bd1.tar.gz |
Fixed bug #67643 (curl_multi_getcontent returns '' when CURLOPT_RETURNTRANSFER isn't set)
-rw-r--r-- | ext/curl/multi.c | 7 |
1 files changed, 5 insertions, 2 deletions
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(); } /* }}} */ |