From 048d71dec3efbcd8727e5a75f82b4fe0dfac41ae Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Fri, 16 Jan 2026 02:54:27 +0100 Subject: [PATCH] FIX warnings with GETPOSTDATE and saverestore (#36886) --- htdocs/core/lib/functions.lib.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bacbc925e4c..04403f1cf46 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1238,7 +1238,15 @@ function GETPOSTDATE($prefix, $hourTime = '', $gm = 'auto', $saverestore = '') $hour = $minute = $second = 0; } - if ($saverestore && !GETPOSTISSET($prefix.'day') && !GETPOSTISSET($prefix.'month') && !GETPOSTISSET($prefix.'year')) { + if ( + $saverestore + && !GETPOSTISSET($prefix . 'day') + && !GETPOSTISSET($prefix . 'month') + && !GETPOSTISSET($prefix . 'year') + && isset($_SESSION['DOLDATE_' . $saverestore . '_day']) + && isset($_SESSION['DOLDATE_' . $saverestore . '_month']) + && isset($_SESSION['DOLDATE_' . $saverestore . '_year']) + ) { $day = $_SESSION['DOLDATE_'.$saverestore.'_day']; $month = $_SESSION['DOLDATE_'.$saverestore.'_month']; $year = $_SESSION['DOLDATE_'.$saverestore.'_year'];