I hope letitia james and arthur engoron get run over by a truck
authorArt Cancro <ajc@citadel.org>
Tue, 27 Feb 2024 04:42:46 +0000 (23:42 -0500)
committerArt Cancro <ajc@citadel.org>
Tue, 27 Feb 2024 04:42:46 +0000 (23:42 -0500)
webcit-ng/server/caldav_reports.c

index 80d6627ba0da9eb70a49a41b63115b646c36efaf..08972cb860b71cec655b5bd58da33c98fcc194e0 100644 (file)
@@ -291,11 +291,17 @@ int caldav_apply_filters(void *cal, Array *filters, int apply_at_level) {
                        syslog(LOG_DEBUG, "caldav: apply_at_level=%d, this_rule_level=%d, skipping this rule", apply_at_level, this_rule_level);
                }
 
-               else if (       (!strcasecmp(t[1], "comp-filter"))
-                               && (!disregard_further_comp_filters)
-                       ) {                                                     // RFC4791 9.7.1 - filter by component
+               else if (       (!strcasecmp(t[1], "comp-filter"))              // RFC4791 9.7.1 - filter by component
+                               && (!disregard_further_comp_filters)            // one is enough to succeed
+                       ) {
                        syslog(LOG_DEBUG, "component filter at level %d", this_rule_level);
 
+                       // comp-filter requires exactly one parameter (name="VXXXX")
+                       if (num_tokens < 4) {
+                               syslog(LOG_DEBUG, "caldav: comp-filter has no parameters - rejecting");
+                               return(0);
+                       }
+
                        // Root element is NOT a component, but the root filter is "comp-filter" -- reject!
                        if ( (!icalcomponent_isa_component(cal)) && (this_rule_level == 0) ) {
                                syslog(LOG_DEBUG, "caldav: root element is not a component, rejecting");
@@ -367,6 +373,9 @@ int caldav_apply_filters(void *cal, Array *filters, int apply_at_level) {
 
                else if (!strcasecmp(t[1], "time-range")) {
                        syslog(LOG_DEBUG, "time range filter at level %d FIXME not implemented yet", this_rule_level);
+                       for (int i=0; i<num_tokens; ++i) {
+                               syslog(LOG_DEBUG, "token %2d : <%s>", i, t[i]);
+                       }
                }
 
                ++f;