X-Git-Url: https://git.p6c8.net/jirafeau.git/blobdiff_plain/a41981033b2828c7fd38a47f8e6410122137f99a..4e94acfa77564a30dfda5a2fb57f978446265e6c:/f.php?ds=sidebyside
diff --git a/f.php b/f.php
index e1c858e..a272ad5 100644
--- a/f.php
+++ b/f.php
@@ -49,6 +49,13 @@ if (!preg_match ('/[0-9a-zA-Z_-]+$/', $link_name))
$link = jirafeau_get_link ($link_name);
if (count ($link) == 0)
+{
+ /* Try alias. */
+ $alias = jirafeau_get_alias (md5 ($link_name));
+ if (count ($alias) > 0)
+ $link = jirafeau_get_link ($alias["destination"]);
+}
+if (count ($link) == 0)
{
require (JIRAFEAU_ROOT.'lib/template/header.php');
echo '
' . t('Sorry, the requested file is not found') .
@@ -135,17 +142,24 @@ if (!empty ($link['key']))
'' .
'
' .
t('By using our services, you accept our'). ' ' . t('Term Of Service') . '' .
- ' |
' .
- '
';
- ?>' .
+ t('Warning, this file will self-destruct after being read') .
+ ' |
';
+ }
+
+ ?>
' . t('Access denied') .
' ';
@@ -176,7 +189,7 @@ if (!empty ($link['key']))
}
}
-if ($cfg['download_page'] && !$password_challenged && !$do_download && !$do_preview)
+if (!$password_challenged && !$do_download && !$do_preview)
{
require (JIRAFEAU_ROOT.'lib/template/header.php');
echo '' .
@@ -185,22 +198,32 @@ if ($cfg['download_page'] && !$password_challenged && !$do_download && !$do_prev
echo '" ' .
'method = "post" id = "submit_post">'; ?>
' .
+ echo '';
@@ -220,9 +243,11 @@ if ($cfg['download_page'] && !$password_challenged && !$do_download && !$do_prev
header ('HTTP/1.0 200 OK');
header ('Content-Length: ' . $link['file_size']);
if (!jirafeau_is_viewable ($link['mime_type']) || !$cfg['preview'] || $do_download)
- header ('Content-Disposition: attachment; filename="' .
- $link['file_name'] . '"');
+ header ('Content-Disposition: attachment; filename="' . $link['file_name'] . '"');
+else
+ header ('Content-Disposition: filename="' . $link['file_name'] . '"');
header ('Content-Type: ' . $link['mime_type']);
+header ('Content-MD5: ' . hex_to_base64($link['md5']));
/* Read encrypted file. */
if ($link['crypted'])
|