]> 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 379b3fa6f729d6058d9a8b3594f62ad6d095aaf9..9a027705d595f98e451116b30a625c75db4a67b3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,8 @@ PHP                                                                        NEWS
 
 - Fixed build of mysqli with MySQL 5.5.0-m2. (Andrey)
 
+- 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 edfd568a0c5fde427bdeddd880f8d18bd5d470f9..92793cdf2b78bb794ccf7eefb0b12ea7bba9d61d 100755 (executable)
@@ -1386,7 +1386,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;