From 62efa30ed239b89538730a9528e10af50cdce1a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 24 May 2021 12:25:17 +0200 Subject: OS: Better validation of invalid input for get_unix_time_from_datetime Default missing keys to Unix time 0 (1970-01-01 at 00:00:00 UTC). Abort if year <= 0, this is not supported by the current algorithm. Prevents an infinite loop further down. Fixes #49022. --- doc/classes/OS.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'doc/classes') diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 05826ecbf0..b8b437f78f 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -368,7 +368,7 @@ Gets an epoch time value from a dictionary of time values. [code]datetime[/code] must be populated with the following keys: [code]year[/code], [code]month[/code], [code]day[/code], [code]hour[/code], [code]minute[/code], [code]second[/code]. - If the dictionary is empty [code]0[/code] is returned. + If the dictionary is empty [code]0[/code] is returned. If some keys are omitted, they default to the equivalent values for the UNIX epoch timestamp 0 (1970-01-01 at 00:00:00 UTC). You can pass the output from [method get_datetime_from_unix_time] directly into this function. Daylight Savings Time ([code]dst[/code]), if present, is ignored. -- cgit v1.2.3