WARNING NOT Y10K COMPLIANT
authorArt Cancro <ajc@citadel.org>
Thu, 21 Mar 2024 17:11:36 +0000 (13:11 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 21 Mar 2024 17:11:36 +0000 (13:11 -0400)
Set min (00010101T010101Z) and max (99991231T235959Z) dates to use when
min or max timestamp is not supplied for comparison

webcit-ng/server/caldav_reports.c

index 188f4bd196c196215f1d2a6b85714543b5958d57..bd451e9e2d5e0821abe75ae54d81630d03f5d238 100644 (file)
@@ -261,11 +261,17 @@ void caldav_report_one_item(struct http_transaction *h, struct ctdlsession *c, S
 // Returns nonzero if the supplied icalcomponent occurs within the specified time range
 int caldav_time_range_filter_matches(icalcomponent *cal_in, char *start_str, char *end_str) {
 
-       struct icaltimetype start = (start_str ? icaltime_from_string(start_str) : icaltime_null_time());
-       struct icaltimetype end = (end_str ? icaltime_from_string(end_str) : icaltime_null_time());
-
-
+       struct icaltimetype start = (
+               start_str
+               ? icaltime_from_string(start_str)
+               : icaltime_from_string("19010101T010101Z")
+       );
 
+       struct icaltimetype end = (
+               end_str
+               ? icaltime_from_string(end_str)
+               : icaltime_from_string("99991231T235959Z")              // ISO8601 is not Y10K compliant
+       );
 
 
 // NOTE TO ME: The header file says