From: Ilia Alshanetsky Date: Tue, 10 Oct 2006 23:17:05 +0000 (+0000) Subject: MFH: Fixed bug #39034 (curl_exec() with return transfer returns TRUE on X-Git-Tag: php-4.4.5RC1~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1346c157a3bc367a895fb7d4586cbe36467031f3;p=php MFH: Fixed bug #39034 (curl_exec() with return transfer returns TRUE on empty files). --- diff --git a/NEWS b/NEWS index 3bad981dd4..ae1b52baf8 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ PHP 4 NEWS ?? ??? 2006, Version 4.4.5 - Updated PCRE to version 6.7. (Ilia) - Fixed missing open_basedir check inside chdir() function. (Ilia) +- Fixed bug #39034 (curl_exec() with return transfer returns TRUE on empty + files). (Ilia) - Fixed bug #38963 (Fixed a possible open_basedir bypass in tempnam()). (Ilia) - Fixed bug #38859 (parse_url() fails if passing '@' in passwd). (Tony,Ilia) - Fixed bug #38534 (segfault when calling setlocale() in userspace session diff --git a/ext/curl/curl.c b/ext/curl/curl.c index ddf022c2dd..0e361b3d4b 100644 --- a/ext/curl/curl.c +++ b/ext/curl/curl.c @@ -1299,6 +1299,8 @@ PHP_FUNCTION(curl_exec) if (ch->handlers->write->type != PHP_CURL_BINARY) smart_str_0(&ch->handlers->write->buf); RETURN_STRINGL(ch->handlers->write->buf.c, ch->handlers->write->buf.len, 0); + } else if (ch->handlers->write->method == PHP_CURL_RETURN) { + RETURN_STRINGL("", sizeof("") - 1, 0); } RETURN_TRUE;