diff options
author | Anatol Belski <ab@php.net> | 2016-10-05 14:54:06 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2016-10-05 14:54:06 +0200 |
commit | 07546496b13e35105dae8e1c168d8356f2dd849d (patch) | |
tree | e0cdfd97e998e94a1f137bfd57a8a24038d18ac1 | |
parent | a10d03ac166daba646b6023e0f12e9ee8040c909 (diff) | |
download | php-git-07546496b13e35105dae8e1c168d8356f2dd849d.tar.gz |
Fix bug #73037, second round
-rw-r--r-- | ext/standard/php_fopen_wrapper.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index ac434ce071..af08c3401d 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -90,7 +90,11 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count } } - php_stream_seek(input->body, input->position, SEEK_SET); + if (!input->body->readfilters.head) { + /* If the input stream contains filters, it's not really seekable. The + input->position is likely to be wrong for unfiltered data. */ + php_stream_seek(input->body, input->position, SEEK_SET); + } read = php_stream_read(input->body, buf, count); if (!read || read == (size_t) -1) { |