diff options
author | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-04 21:39:53 +0100 |
---|---|---|
committer | Gerrit Uitslag <klapinklapin@gmail.com> | 2014-03-04 21:39:53 +0100 |
commit | 603c1a1e6dfa9f1bc6759843283a8a7995c613f8 (patch) | |
tree | 61349b0905bf69e2370f150d6e32901bad1aa25f /inc/httputils.php | |
parent | b35d34217e073f330111fea5812fa4d88680a4ef (diff) | |
parent | 4b142187c1238555a14d79ff6e054a678ce828f3 (diff) | |
download | rpg-603c1a1e6dfa9f1bc6759843283a8a7995c613f8.tar.gz rpg-603c1a1e6dfa9f1bc6759843283a8a7995c613f8.tar.bz2 |
Merge remote-tracking branch 'origin/master' into FS#2124deniedtext
Conflicts:
inc/lang/bn/lang.php
inc/lang/fr/denied.txt
Diffstat (limited to 'inc/httputils.php')
-rw-r--r-- | inc/httputils.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/inc/httputils.php b/inc/httputils.php index 003733ede..efeb2a56c 100644 --- a/inc/httputils.php +++ b/inc/httputils.php @@ -64,13 +64,13 @@ function http_conditionalRequest($timestamp){ * Let the webserver send the given file via x-sendfile method * * @author Chris Smith <chris@jalakai.co.uk> - * @param $file - * @returns bool or exits with previously header() commands executed + * @param string $file absolute path of file to send + * @returns void or exits with previous header() commands executed */ function http_sendfile($file) { global $conf; - //use x-sendfile header to pass the delivery to compatible webservers + //use x-sendfile header to pass the delivery to compatible web servers if($conf['xsendfile'] == 1){ header("X-LIGHTTPD-send-file: $file"); ob_end_clean(); @@ -80,12 +80,12 @@ function http_sendfile($file) { ob_end_clean(); exit; }elseif($conf['xsendfile'] == 3){ + // FS#2388 nginx just needs the relative path. + $file = DOKU_REL.substr($file, strlen(fullpath(DOKU_INC)) + 1); header("X-Accel-Redirect: $file"); ob_end_clean(); exit; } - - return false; } /** @@ -224,7 +224,8 @@ function http_cached($cache, $cache_ok) { header('Content-Encoding: gzip'); readfile($cache.".gz"); } else { - if (!http_sendfile($cache)) readfile($cache); + http_sendfile($cache); + readfile($cache); } exit; } |