summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Smith <chris@jalakai.co.uk>2014-03-02 21:09:25 +0000
committerChristopher Smith <chris@jalakai.co.uk>2014-03-02 21:09:25 +0000
commit4b142187c1238555a14d79ff6e054a678ce828f3 (patch)
tree2d2a398218964e3bee0876385f9c8786a3baf8de
parent709fd92548efedbd4b4e5693097165d1dff072e4 (diff)
parentf327a5f0a9ef72e6dd79d9d200f81c330aa4903c (diff)
downloadrpg-4b142187c1238555a14d79ff6e054a678ce828f3.tar.gz
rpg-4b142187c1238555a14d79ff6e054a678ce828f3.tar.bz2
Merge pull request #581 from splitbrain/FS#2388_merged
FS#2388_merged
-rw-r--r--inc/actions.php2
-rw-r--r--inc/fetch.functions.php2
-rw-r--r--inc/httputils.php13
3 files changed, 9 insertions, 8 deletions
diff --git a/inc/actions.php b/inc/actions.php
index 50cbe369f..4dbad1a32 100644
--- a/inc/actions.php
+++ b/inc/actions.php
@@ -697,7 +697,7 @@ function act_sitemap($act) {
// Send file
//use x-sendfile header to pass the delivery to compatible webservers
- if (http_sendfile($sitemap)) exit;
+ http_sendfile($sitemap);
readfile($sitemap);
exit;
diff --git a/inc/fetch.functions.php b/inc/fetch.functions.php
index 3eacaa2fe..c61c54503 100644
--- a/inc/fetch.functions.php
+++ b/inc/fetch.functions.php
@@ -77,7 +77,7 @@ function sendFile($file, $mime, $dl, $cache, $public = false, $orig = null) {
}
//use x-sendfile header to pass the delivery to compatible webservers
- if(http_sendfile($file)) exit;
+ http_sendfile($file);
// send file contents
$fp = @fopen($file, "rb");
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;
}