mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
Merge pull request #20385 from nextcloud/skeeable-http-harden
harden seekable http stream a bit against failures
This commit is contained in:
commit
fb64fda4d8
1 changed files with 13 additions and 3 deletions
|
|
@ -149,15 +149,25 @@ class SeekableHttpStream implements File {
|
|||
}
|
||||
|
||||
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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue