From d5b2007bed52ae145e4c0821771871857d75d52f Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 6 Jan 2010 12:54:53 +0000 Subject: [PATCH] Fixed bug #50657 (copy() with an empty (zero-byte) HTTP source succeeds but returns false). --- NEWS | 2 ++ main/streams/streams.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 939a546257..bb401046bf 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ PHP NEWS (Ilia) - Added stream_resolve_include_path(). (Mikko) +- Fixed bug #50657 (copy() with an empty (zero-byte) HTTP source succeeds + but returns false). (Ilia) - Fixed bug #50636 (MySQLi_Result sets values before calling constructor). (Pierrick) - Fixed bug #50632 (filter_input() does not return default value if the diff --git a/main/streams/streams.c b/main/streams/streams.c index 65b1ce6087..ce561a6175 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1396,7 +1396,7 @@ PHPAPI size_t _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, s /* we've got at least 1 byte to read. * less than 1 is an error */ - if (haveread > 0) { + if (haveread > 0 || src->eof) { return SUCCESS; } return FAILURE; -- 2.40.0