Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
harden seekable http stream a bit against failures
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 authored and MorrisJobke committed May 22, 2020
commit e471c37b9b8f9a45f59a1eb5acd40bf1f6cc9231
16 changes: 13 additions & 3 deletions lib/private/Files/Stream/SeekableHttpStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,15 +149,25 @@ public function stream_tell() {
}

public function stream_stat() {
return fstat($this->current);
if (is_resource($this->current)) {
return fstat($this->current);
} else {
return false;
}
}

public function stream_eof() {
return feof($this->current);
if (is_resource($this->current)) {
return feof($this->current);
} else {
return true;
}
}

public function stream_close() {
fclose($this->current);
if (is_resource($this->current)) {
fclose($this->current);
}
}

public function stream_write($data) {
Expand Down