Possible bug in the implementation of php://input streams?
| From: | Rasmus Schultz | Date: | Wed, 16 Jan 2019 07:59:55 +0000 |
| Subject: | Possible bug in the implementation of php://input streams? | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-103751@lists.php.net to get a copy of this message | ||
We've noticed something odd about the "php://input" stream.
This type of stream resource reports itself as seekable:
assert(stream_get_meta_data(fopen("php://input", "r"))["seekable"] ===
true);
https://3v4l.org/EFLiO
If you attempt to rewind() it after reading the stream, rewind() returns
true, and ftell() subequently returns 0.
However, attempting to read the stream again after that returns nothing.
On the other hand, if you fopen() a new resource, it is readable again
after all.
So it seems, either the "php://input" stream implementation is somehow
broken - or it's incorrectly reporting as seekable?
Any idea?