From 2d8ddcb6821c945107ea56949e823fd1b98f8f80 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) --- NEWS | 1 + ext/standard/php_fopen_wrapper.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 2f51a96b85..7cbd644c50 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,7 @@ PHP NEWS - Fixed bug #49289 (bcmath module doesn't compile with phpize configure). (Jani) +- Fixed bug #49286 (php://input (php_stream_input_read) is broken). (Jani) - Fixed bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration). (Etienne, Dmitry) - Fixed bug #49236 (Missing PHP_SUBST(PDO_MYSQL_SHARED_LIBADD)). (Jani) diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 1008fb422b..2ea800804f 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.40.0