summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2016-10-05 15:03:38 +0200
committerAnatol Belski <ab@php.net>2016-10-05 15:03:38 +0200
commit5b79e95f7b6366bf139feaf4e8e5c65db26ddd03 (patch)
treee1ea093b27fbe89dc65e54ec30ee43fc68661eac
parent4790da5475c80469eeaac777f3f04815648e3d96 (diff)
parent07546496b13e35105dae8e1c168d8356f2dd849d (diff)
downloadphp-git-5b79e95f7b6366bf139feaf4e8e5c65db26ddd03.tar.gz
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6: Fix bug #73037, second round
-rw-r--r--ext/standard/php_fopen_wrapper.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index 759a4f6a33..88eab46409 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) {