]> granicus.if.org Git - php/commitdiff
- Fixed bug #49286 (php://input (php_stream_input_read) is broken)
authorJani Taskinen <jani@php.net>
Thu, 20 Aug 2009 12:40:15 +0000 (12:40 +0000)
committerJani Taskinen <jani@php.net>
Thu, 20 Aug 2009 12:40:15 +0000 (12:40 +0000)
ext/standard/php_fopen_wrapper.c

index 87bc989b165a69b17ceba4752d71f1823c71a49f..849e61fa5ec3cb6f1035f21e497e34a363d7ca3d 100644 (file)
@@ -91,13 +91,14 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count
                                stream->eof = 1;
                                read_bytes = 0;
                        }
+                       /* Increment SG(read_post_bytes) only when something was actually read. */
+                       SG(read_post_bytes) += read_bytes;
                } else {
                        stream->eof = 1;
                }
        }
 
        *position += read_bytes;
-       SG(read_post_bytes) += read_bytes;
 
        return read_bytes;
 }