removed a little duplication

This commit is contained in:
dratini0 2014-12-30 22:36:13 +01:00
parent f2075f803f
commit 31970ee740
1 changed files with 1 additions and 3 deletions

View File

@ -161,12 +161,11 @@ class OC_Files {
* @param false|string $filename
*/
private static function addSendfileHeader($filename) {
if (isset($_SERVER['MOD_X_SENDFILE_ENABLED'])) {
$filename = \OC\Files\Filesystem::getLocalFile($filename);
if (isset($_SERVER['MOD_X_SENDFILE_ENABLED'])) {
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);
@ -182,7 +181,6 @@ class OC_Files {
}
if (isset($_SERVER['MOD_X_ACCEL_REDIRECT_ENABLED'])) {
$filename = \OC\Files\Filesystem::getLocalFile($filename);
header("X-Accel-Redirect: " . $filename);
}
}