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:
authorVincent Petry <pvince81@owncloud.com>2013-11-20 17:33:59 +0400
committerVincent Petry <pvince81@owncloud.com>2013-11-20 17:33:59 +0400
commit726a202cdb9471a0bc4c6c27e59469af1e39a32e (patch)
treea80f281d2b2bde1cefab973ede198d42888414a0 /lib
parent8bc339413ba2221fea9447f91ae093f3f1cf2ab4 (diff)
Fixed getLocalFile() condition for x-send-file
Until now, addSendfileHeader() was called even when no x-send-file headers were set. Even though the method itself doesn't do anything, a call to getLocalFile() was done and would trigger a full download when using external storage. Additionally, the storage resolution code is wrong and always returns the local storage of the root filesystem, which caused the code to be run anyway. This commit fixes both issues.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/files.php b/lib/private/files.php
index 8b4d5c59aee..e76dd8644c1 100644
--- a/lib/private/files.php
+++ b/lib/private/files.php
@@ -131,9 +131,11 @@ class OC_Files {
if ($filesize > -1) {
header("Content-Length: ".$filesize);
}
- list($storage) = \OC\Files\Filesystem::resolvePath($filename);
- if ($storage instanceof \OC\Files\Storage\Local) {
- self::addSendfileHeader(\OC\Files\Filesystem::getLocalFile($filename));
+ if ($xsendfile) {
+ list($storage) = \OC\Files\Filesystem::resolvePath(\OC\Files\Filesystem::getView()->getAbsolutePath($filename));
+ if ($storage instanceof \OC\Files\Storage\Local) {
+ self::addSendfileHeader(\OC\Files\Filesystem::getLocalFile($filename));
+ }
}
}
} elseif ($zip or !\OC\Files\Filesystem::file_exists($filename)) {