From: Patrick Canterino Date: Fri, 16 Oct 2026 09:29:39 +0000 (+0200) Subject: Merge branch 'fix-onetime-download-stats' into 'next-release' X-Git-Tag: 4.8.0~16 X-Git-Url: https://git.p6c8.net/jirafeau/jirafeau.git/commitdiff_plain/refs/pipelines/2954490479?hp=-c Merge branch 'fix-onetime-download-stats' into 'next-release' Write download stats before deleting one-time link See merge request jirafeau/Jirafeau!40 --- 7ce7490a06416f2f47cfae72bc2baf0188d38f22 diff --combined f.php index 3523596,954b588..9454540 --- a/f.php +++ b/f.php @@@ -36,7 -36,7 +36,7 @@@ if (!isset($_GET['h']) || empty($_GET[' $link_name = $_GET['h']; -if (!preg_match('/[0-9a-zA-Z_-]+$/', $link_name)) { +if (!preg_match('/^[0-9a-zA-Z_-]+$/', $link_name)) { require(JIRAFEAU_ROOT.'lib/template/header.php'); echo '

' . t('FILE_404') . '

'; require(JIRAFEAU_ROOT.'lib/template/footer.php'); @@@ -82,7 -82,7 +82,7 @@@ if (!file_exists(VAR_FILES . $p . $link exit; } -if (!empty($delete_code) && $delete_code == $link['link_code']) { +if (!empty($delete_code) && hash_equals((string) $link['link_code'], (string) $delete_code)) { require(JIRAFEAU_ROOT.'lib/template/header.php'); if (isset($_POST['do_delete'])) { jirafeau_delete_link($link_name); @@@ -274,12 -274,12 +274,12 @@@ else } } + jirafeau_write_download_stats($link_name, get_ip_address($cfg)); + if ($link['onetime'] == 'O') { jirafeau_delete_link($link_name); } - jirafeau_write_download_stats($link_name, get_ip_address($cfg)); - exit; ?>