X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/b6f423726c6f71c769fc7d7f3b842f623595a808..d80bc81c62a4775758a3c97e6506a9d26014b75e:/f.php diff --git a/f.php b/f.php index ed7d782..e167154 100644 --- a/f.php +++ b/f.php @@ -89,8 +89,8 @@ if (!empty($delete_code) && $delete_code == $link['link_code']) { '
'; } else { ?>' . t('GIMME_PSW') . ' : ' . - '' . + '' . ' |
' . t('USING_SERVICE'). ' ' . t('TOS') . '.' . @@ -250,8 +248,12 @@ if ($cfg['litespeed_workaround']) { $_SERVER['QUERY_STRING'] . '&litespeed_workaround=phase2'); } } -/* Read encrypted file. */ +/* Read encrypted file (Sodium mode). */ elseif ($link['crypted']) { + jirafeau_decrypt_file(VAR_FILES . $p . $link['hash'], 'php://output', $crypt_key); +} +/* Read encrypted file (legacy mode using mcrypt). */ +elseif ($link['crypted_legacy']) { /* Init module */ $m = mcrypt_module_open('rijndael-256', '', 'ofb', ''); /* Extract key and iv. */ @@ -272,16 +274,24 @@ 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') { jirafeau_delete_link($link_name); } + +jirafeau_write_download_stats($link_name, get_ip_address($cfg)); + exit; ?> |