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=d50b4e1167fdbe6162f42db2841b55dc57fb9a21 Merge branch 'fix-onetime-download-stats' into 'next-release' Write download stats before deleting one-time link See merge request jirafeau/Jirafeau!40 --- diff --git a/CHANGELOG.md b/CHANGELOG.md index c03d0b5..a85065c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ 5. Follow the installation wizard, it should propose you the same data folder or even update automatically 6. Check your `/lib/config.local.php` and compare it with the `/lib/config.original.php` to see if new configuration items are available. If a new item is missing in your `config.local.php`, this may trigger some errors as Jirafeau may expect to have them. +## Version 4.7.x (not yet released) + +- ... + ## Version 4.7.2 - Added a button for showing the download password before uploading the file diff --git a/f.php b/f.php index 954b588..9454540 100644 --- a/f.php +++ b/f.php @@ -36,7 +36,7 @@ if (!isset($_GET['h']) || empty($_GET['h'])) { $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 @@ if (!file_exists(VAR_FILES . $p . $link['hash'])) { 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); diff --git a/index.php b/index.php index 82b3c8c..d60cb18 100644 --- a/index.php +++ b/index.php @@ -158,7 +158,7 @@ if ($cfg['download_password_requirement'] === 'generated') { echo ''; echo ' " size = "40" /> | '; - echo ' ' . t('DESIGNED') . ' ' . $cfg['organisation']; + echo ' ' . t('DESIGNED') . ' ' . jirafeau_escape($cfg['organisation']); } echo ' | '; diff --git a/lib/template/header.php b/lib/template/header.php index 93f7e18..c1a94de 100644 --- a/lib/template/header.php +++ b/lib/template/header.php @@ -6,10 +6,10 @@ header('x-ua-compatible: ie=edge'); - <?php echo (true === empty($cfg['title'])) ? t('JI_WEB_RE') : $cfg['title']; ?> + <?php echo (true === empty($cfg['title'])) ? t('JI_WEB_RE') : jirafeau_escape($cfg['title']); ?> - - + + @@ -17,6 +17,6 @@ header('x-ua-compatible: ie=edge');

- +

diff --git a/script.php b/script.php index 301ebe8..2fc297f 100644 --- a/script.php +++ b/script.php @@ -163,7 +163,7 @@ if (isset($_FILES['file']) && is_writable(VAR_FILES) $d = $_GET['d']; } - if (!preg_match('/[0-9a-zA-Z_-]+$/', $link_name)) { + if (!preg_match('/^[0-9a-zA-Z_-]+$/', $link_name)) { echo 'Error 7'; exit; }