From c9f63a7ce2a3f1827e860365b619940236a20d9b Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 26 May 2016 14:42:13 -0400 Subject: [PATCH] (fix) make sure to strip X- tags when securing content (#3695) --- SoObjects/Appointments/SOGoCalendarComponent.m | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/SoObjects/Appointments/SOGoCalendarComponent.m b/SoObjects/Appointments/SOGoCalendarComponent.m index 6d12c78d9..eb6ccebaf 100644 --- a/SoObjects/Appointments/SOGoCalendarComponent.m +++ b/SoObjects/Appointments/SOGoCalendarComponent.m @@ -202,8 +202,10 @@ - (void) _filterComponent: (iCalEntityObject *) component { - NSString *type, *summary; - int classification; + NSString *type, *summary, *tag; + NSArray *children; + + int classification, i; type = @"vtodo"; classification = 0; @@ -225,8 +227,19 @@ [component setLocation: @""]; [component setCategories: [NSArray array]]; [component setUrl: @""]; + [component setOrganizer: nil]; [component removeAllAttendees]; [component removeAllAlarms]; + + // We strip all X- tags + children = [component children]; + + for (i = 0; i < [children count]; i++) + { + tag = [[children objectAtIndex: i] tag]; + if ([[tag uppercaseString] hasPrefix: @"X-"]) + [component removeChild: [children objectAtIndex: i]]; + } } - (NSString *) secureContentAsString