X-Git-Url: https://git.p6c8.net/jirafeau_project.git/blobdiff_plain/b6f423726c6f71c769fc7d7f3b842f623595a808..6f6cfb13fc72f4baac6f6bd53e5c1c20f9715c9e:/f.php diff --git a/f.php b/f.php index ed7d782..f7f3786 100644 --- a/f.php +++ b/f.php @@ -142,7 +142,7 @@ if (!empty($link['key'])) { '' . t('PSW_PROTEC') . '' . '
' . t('GIMME_PSW') . ' : ' . - '' . + '' . '
' . t('USING_SERVICE'). ' ' . t('TOS') . '.' . @@ -272,11 +272,16 @@ elseif ($link['crypted']) { } /* Read file. */ else { - $r = fopen(VAR_FILES . $p . $link['hash'], 'r'); - while (!feof($r)) { - print fread($r, 1024); + if ($cfg['use_xsendfile']) { + $file_web_path = preg_replace('#^' . $_SERVER['DOCUMENT_ROOT'] . '#', '', VAR_FILES); + header('X-Sendfile: ' . $file_web_path . $p . $link['hash']); + } else { + $r = fopen(VAR_FILES . $p . $link['hash'], 'r'); + while (!feof($r)) { + print fread($r, 1024); + } + fclose($r); } - fclose($r); } if ($link['onetime'] == 'O') {