Skip to content
Closed
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 backportbot[bot] committed May 25, 2020
commit aa39d8c8af5ec8cdf0890b00afffcf047e3278b5
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