summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/private/files.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/files.php b/lib/private/files.php
index 3affcf10449..c435f8d1684 100644
--- a/lib/private/files.php
+++ b/lib/private/files.php
@@ -152,7 +152,7 @@ class OC_Files {
/** @var $storage \OC\Files\Storage\Storage */
list($storage) = $view->resolvePath($filename);
if ($storage->isLocal()) {
- self::addSendfileHeader(\OC\Files\Filesystem::getLocalFile($filename));
+ self::addSendfileHeader($filename);
} else {
\OC\Files\Filesystem::readfile($filename);
}
@@ -167,9 +167,11 @@ class OC_Files {
*/
private static function addSendfileHeader($filename) {
if (isset($_SERVER['MOD_X_SENDFILE_ENABLED'])) {
+ $filename = \OC\Files\Filesystem::getLocalFile($filename);
header("X-Sendfile: " . $filename);
}
if (isset($_SERVER['MOD_X_SENDFILE2_ENABLED'])) {
+ $filename = \OC\Files\Filesystem::getLocalFile($filename);
if (isset($_SERVER['HTTP_RANGE']) &&
preg_match("/^bytes=([0-9]+)-([0-9]*)$/", $_SERVER['HTTP_RANGE'], $range)) {
$filelength = filesize($filename);
@@ -185,6 +187,7 @@ class OC_Files {
}
if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) {
+ $filename = \OC::$WEBROOT . '/data' . \OC\Files\Filesystem::getRoot() . $filename;
header("X-Accel-Redirect: " . $filename);
}
}