From: Patrick Canterino Date: Fri, 16 Oct 2026 09:30:12 +0000 (+0200) Subject: Merge branch 'optional-time-param' into 'next-release' X-Git-Tag: 4.8.0~15 X-Git-Url: https://git.p6c8.net/jirafeau/jirafeau.git/commitdiff_plain/1bebef3b533b418b2dcde655fccc5a2f22897e89?hp=-c Merge branch 'optional-time-param' into 'next-release' Make time parameter optional in script.php See merge request jirafeau/Jirafeau!38 --- 1bebef3b533b418b2dcde655fccc5a2f22897e89 diff --combined script.php index 2fc297f,1b969fa..bcca4f7 --- a/script.php +++ b/script.php @@@ -94,7 -94,9 +94,9 @@@ if (isset($_FILES['file']) && is_writab exit; } - if (!isset($_POST['time']) || !$cfg['availabilities'][$_POST['time']]) { + if (!isset($_POST['time'])) { + $time = jirafeau_datestr_to_int($cfg['availability_default']); + } elseif (!$cfg['availabilities'][$_POST['time']]) { echo 'Error 4: The parameter time is invalid.'; exit; } else { @@@ -163,7 -165,7 +165,7 @@@ $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; } @@@ -441,7 -443,9 +443,9 @@@ elseif (isset($_GET['init_async'])) exit; } - if (!isset($_POST['time']) || !$cfg['availabilities'][$_POST['time']]) { + if (!isset($_POST['time'])) { + $time = jirafeau_datestr_to_int($cfg['availability_default']); + } elseif (!$cfg['availabilities'][$_POST['time']]) { echo 'Error 22'; exit; } else {