X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/blobdiff_plain/379a0267c27b3731c60b7221f8f533aaf418fcae..d598ed64ed220d9bc3113add823c93310c68ad38:/f.php diff --git a/f.php b/f.php index bcf0848..f6fe6fd 100644 --- a/f.php +++ b/f.php @@ -2,7 +2,7 @@ /* * Jirafeau, your web file repository * Copyright (C) 2008 Julien "axolotl" BERNARD - * Copyright (C) 2015 Jerome Jutteau + * Copyright (C) 2015 Jerome Jutteau * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -32,14 +32,12 @@ if (!isset($_GET['h']) || empty($_GET['h'])) { * Be sure PHP's safe mode is off. */ @set_time_limit(0); -/* Remove errors. */ -@error_reporting(0); $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; } @@ -47,7 +45,7 @@ if (!preg_match('/[0-9a-zA-Z_-]+$/', $link_name)) { $link = jirafeau_get_link($link_name); 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; @@ -73,21 +71,43 @@ if (isset($_GET['p']) && !empty($_GET['p'])) { $do_preview = true; } -$p = s2p($link['md5']); -if (!file_exists(VAR_FILES . $p . $link['md5'])) { +$p = s2p($link['hash']); +if (!file_exists(VAR_FILES . $p . $link['hash'])) { 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; @@ -105,7 +125,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; @@ -119,20 +139,20 @@ if (!empty($link['key'])) { '