Skip to content

Commit c43612c

Browse files
author
Dylan Donkersgoed
committed
Made stream_stat() ignore StreamUtil::getSize() result if it is 0 to fix issue twistor#21
1 parent 719bf17 commit c43612c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/FlysystemStreamWrapper.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,13 @@ public function stream_stat()
603603

604604
// Use the size of our handle, since it could have been written to or
605605
// truncated.
606-
$stat['size'] = $stat[7] = StreamUtil::getSize($this->handle);
606+
$stream_util_size = StreamUtil::getSize($this->handle);
607+
if ($stream_util_size) {
608+
$stat['size'] = $stat[7] = $stream_util_size;
609+
}
610+
else {
611+
$stat['size'] = $stat[7];
612+
}
607613

608614
return $stat;
609615
}

0 commit comments

Comments
 (0)