Stream checks isSeeakable before calling rewind in __toString
This commit is contained in:
parent
15da2ab805
commit
b06abc0df2
|
|
@ -48,7 +48,9 @@ class Stream implements StreamInterface
|
||||||
{
|
{
|
||||||
$string = "";
|
$string = "";
|
||||||
try {
|
try {
|
||||||
rewind($this->resource);
|
if ($this->isSeekable()) {
|
||||||
|
rewind($this->resource);
|
||||||
|
}
|
||||||
$string = $this->getContents();
|
$string = $this->getContents();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
// Silence exceptions in order to conform with PHP's string casting operations.
|
// Silence exceptions in order to conform with PHP's string casting operations.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue