Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-04-10 09:34:52 +0300
committerGitHub <noreply@github.com>2020-04-10 09:34:52 +0300
commitfb64fda4d82af1608f13bf23801e63861951e2fb (patch)
tree8e3cb65aee457c4a0b925dea0e2dfcd5065ca7cd /lib
parent7799eef90e9686ef77f7d62887175b35d682f538 (diff)
parent60de74ac4035848700bdf569e1be3887ad633a3f (diff)
Merge pull request #20385 from nextcloud/skeeable-http-harden
harden seekable http stream a bit against failures
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Stream/SeekableHttpStream.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/private/Files/Stream/SeekableHttpStream.php b/lib/private/Files/Stream/SeekableHttpStream.php
index fdcd9ea8cfb..113ba19a17a 100644
--- a/lib/private/Files/Stream/SeekableHttpStream.php
+++ b/lib/private/Files/Stream/SeekableHttpStream.php
@@ -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) {