[Pkg-owncloud-commits] [owncloud] 03/103: Backporting #14125 to stable8, as called for by @LukasReschke
David Prévot
taffit at moszumanska.debian.org
Sun May 31 12:32:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v8.0.4RC1
in repository owncloud.
commit 86d3f85379e2f44f2bcbcc36b821e61d5caca4b9
Author: dratini0 <dratini0 at gmail.com>
Date: Fri Mar 27 21:57:59 2015 +0100
Backporting #14125 to stable8, as called for by @LukasReschke
---
lib/private/files.php | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/lib/private/files.php b/lib/private/files.php
index 496ba1b..b7df99c 100644
--- a/lib/private/files.php
+++ b/lib/private/files.php
@@ -161,11 +161,12 @@ class OC_Files {
* @param false|string $filename
*/
private static function addSendfileHeader($filename) {
- $filename = \OC\Files\Filesystem::getLocalFile($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);
@@ -181,6 +182,11 @@ class OC_Files {
}
if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) {
+ if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_PREFIX'])) {
+ $filename = $_SERVER['MOD_X_ACCEL_REDIRECT_PREFIX'] . \OC\Files\Filesystem::getLocalFile($filename);
+ } else {
+ $filename = \OC::$WEBROOT . '/data' . \OC\Files\Filesystem::getRoot() . $filename;
+ }
header("X-Accel-Redirect: " . $filename);
}
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list