]> 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)
NEWS
ext/standard/php_fopen_wrapper.c

diff --git a/NEWS b/NEWS
index 2f51a96b8570bb55d4ea5da43a7705cd10f8da68..7cbd644c50a0fb39a3e8a6b4845653851254caeb 100644 (file)
--- 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)
index 1008fb422b6f848ec02dea69b9462376945ec0b1..2ea800804f544d6ae714b83f918fbd152e0d338f 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;
 }