From f3f8bd086e163d1cbbba0e6908d0db46d26b8567 Mon Sep 17 00:00:00 2001 From: Jani Taskinen Date: Thu, 20 Aug 2009 12:40:15 +0000 Subject: [PATCH] - Fixed bug #49286 (php://input (php_stream_input_read) is broken) --- ext/standard/php_fopen_wrapper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 87bc989b16..849e61fa5e 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -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; } -- 2.50.1