diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 43956f87b1a..4b7bfdf1cb6 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1235,7 +1235,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'];