From: Jani Taskinen Date: Thu, 20 Aug 2009 12:40:15 +0000 (+0000) Subject: - Fixed bug #49286 (php://input (php_stream_input_read) is broken) X-Git-Tag: php-5.4.0alpha1~191^2~2774 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3f8bd086e163d1cbbba0e6908d0db46d26b8567;p=php - Fixed bug #49286 (php://input (php_stream_input_read) is broken) --- 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; }