X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/fd3aaad433fe7e041f85752a727bb14b8865dc31..48f14e7b05a452683cf059b767ea6b071a300edd:/f.php?ds=sidebyside diff --git a/f.php b/f.php index 0f40638..5fd8575 100644 --- a/f.php +++ b/f.php @@ -24,7 +24,7 @@ require(JIRAFEAU_ROOT . 'lib/functions.php'); require(JIRAFEAU_ROOT . 'lib/lang.php'); if (!isset($_GET['h']) || empty($_GET['h'])) { - header('Location: ' . $cfg['web_root']); + header('Location: ./'); exit; } @@ -39,22 +39,15 @@ $link_name = $_GET['h']; if (!preg_match('/[0-9a-zA-Z_-]+$/', $link_name)) { require(JIRAFEAU_ROOT.'lib/template/header.php'); - echo '

' . t('Sorry, the requested file is not found') . '

'; + echo '

' . t('FILE_404') . '

'; require(JIRAFEAU_ROOT.'lib/template/footer.php'); exit; } $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') . + echo '

' . t('FILE_404') . '

'; require(JIRAFEAU_ROOT.'lib/template/footer.php'); exit; @@ -84,17 +77,39 @@ $p = s2p($link['md5']); if (!file_exists(VAR_FILES . $p . $link['md5'])) { jirafeau_delete_link($link_name); require(JIRAFEAU_ROOT.'lib/template/header.php'); - echo '

'.t('File not available.'). + echo '

'.t('FILE_NOT_AVAIL'). '

'; require(JIRAFEAU_ROOT.'lib/template/footer.php'); exit; } if (!empty($delete_code) && $delete_code == $link['link_code']) { - jirafeau_delete_link($link_name); require(JIRAFEAU_ROOT.'lib/template/header.php'); - echo '

'.t('File has been deleted.'). - '

'; + if (isset($_POST['do_delete'])) { + jirafeau_delete_link($link_name); + echo '

'.t('FILE_DELETED'). + '

'; + } else { ?> +
+
$link['time']) { jirafeau_delete_link($link_name); require(JIRAFEAU_ROOT.'lib/template/header.php'); echo '

'. - t('The time limit of this file has expired.') . ' ' . - t('File has been deleted.') . + t('FILE_EXPIRED') . ' ' . + t('FILE_DELETED') . '

'; require(JIRAFEAU_ROOT . 'lib/template/footer.php'); exit; @@ -112,7 +127,7 @@ if ($link['time'] != JIRAFEAU_INFINITY && time() > $link['time']) { if (empty($crypt_key) && $link['crypted']) { require(JIRAFEAU_ROOT.'lib/template/header.php'); - echo '

' . t('Sorry, the requested file is not found') . + echo '

' . t('FILE_404') . '

'; require(JIRAFEAU_ROOT.'lib/template/footer.php'); exit; @@ -123,36 +138,33 @@ if (!empty($link['key'])) { if (!isset($_POST['key'])) { require(JIRAFEAU_ROOT.'lib/template/header.php'); echo '
' . - '