aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Stream/SeekableHttpStream.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Stream/SeekableHttpStream.php')
-rw-r--r--lib/private/Files/Stream/SeekableHttpStream.php29
1 files changed, 7 insertions, 22 deletions
diff --git a/lib/private/Files/Stream/SeekableHttpStream.php b/lib/private/Files/Stream/SeekableHttpStream.php
index 51ccaeba998..6ce0a880e8d 100644
--- a/lib/private/Files/Stream/SeekableHttpStream.php
+++ b/lib/private/Files/Stream/SeekableHttpStream.php
@@ -1,25 +1,8 @@
<?php
+
/**
- * @copyright Copyright (c) 2020, Lukas Stabe (lukas@stabe.de)
- *
- * @author Lukas Stabe <lukas@stabe.de>
- * @author Robin Appelman <robin@icewind.nl>
- *
- * @license GNU AGPL version 3 or any later version
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\Files\Stream;
@@ -108,7 +91,7 @@ class SeekableHttpStream implements File {
continue 2;
}
}
- throw new \Exception("Failed to get source stream from stream wrapper of " . get_class($responseHead));
+ throw new \Exception('Failed to get source stream from stream wrapper of ' . get_class($responseHead));
}
$rangeHeaders = array_values(array_filter($responseHead, function ($v) {
@@ -219,7 +202,9 @@ class SeekableHttpStream implements File {
public function stream_stat() {
if ($this->getCurrent()) {
$stat = fstat($this->getCurrent());
- $stat['size'] = $this->totalSize;
+ if ($stat) {
+ $stat['size'] = $this->totalSize;
+ }
return $stat;
} else {
return false;