]> granicus.if.org Git - php/commitdiff
Fixed bug #50657 (copy() with an empty (zero-byte) HTTP source succeeds but returns...
authorIlia Alshanetsky <iliaa@php.net>
Wed, 6 Jan 2010 12:54:53 +0000 (12:54 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 6 Jan 2010 12:54:53 +0000 (12:54 +0000)
NEWS
main/streams/streams.c

diff --git a/NEWS b/NEWS
index 939a546257a6e3a1084e52d4f104d294ea540bc0..bb401046bf5e613801432fc393e4b63a2d019b14 100644 (file)
--- 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
index 65b1ce608747fb199efeb6edd267da2b00575d5c..ce561a6175722af17d6f6de87e498cd81c653509 100755 (executable)
@@ -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;