(fix) prevent characters in calendar component UID causing issues during import process
parent
fdb36970d4
commit
d51d5c85b0
1
NEWS
1
NEWS
|
@ -13,6 +13,7 @@ Bug fixes
|
||||||
- EAS fix for wrong charset being used (#3392)
|
- EAS fix for wrong charset being used (#3392)
|
||||||
- EAS fix on qp-encoded subjects (#3390)
|
- EAS fix on qp-encoded subjects (#3390)
|
||||||
- correctly handle all-day event exceptions when the master event changes
|
- correctly handle all-day event exceptions when the master event changes
|
||||||
|
- prevent characters in calendar component UID causing issues during import process
|
||||||
|
|
||||||
2.3.3a (2015-11-18)
|
2.3.3a (2015-11-18)
|
||||||
-------------------
|
-------------------
|
||||||
|
|
|
@ -3160,19 +3160,29 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||||
NSMutableString *content;
|
NSMutableString *content;
|
||||||
NSString *uid;
|
NSString *uid;
|
||||||
|
|
||||||
// We first look if there's an event with the same UID in our calendar. If not,
|
// We first look if the event has any / or + in its UID. If that's the case
|
||||||
// let's reuse what is in the event, otherwise generate a new GUID and use it.
|
// we generate a new UID based on a GUID
|
||||||
uid = [event uid];
|
uid = [event uid];
|
||||||
|
|
||||||
object = [self lookupName: uid
|
if ([uid rangeOfCharacterFromSet: [NSCharacterSet characterSetWithCharactersInString: @"+/"]].location != NSNotFound)
|
||||||
inContext: context
|
|
||||||
acquire: NO];
|
|
||||||
|
|
||||||
if (object && ![object isKindOfClass: [NSException class]])
|
|
||||||
{
|
{
|
||||||
uid = [self globallyUniqueObjectId];
|
uid = [self globallyUniqueObjectId];
|
||||||
[event setUid: uid];
|
[event setUid: uid];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// We also look if there's an event with the same UID in our calendar. If not,
|
||||||
|
// let's reuse what is in the event, otherwise generate a new GUID and use it.
|
||||||
|
object = [self lookupName: uid
|
||||||
|
inContext: context
|
||||||
|
acquire: NO];
|
||||||
|
|
||||||
|
if (object && ![object isKindOfClass: [NSException class]])
|
||||||
|
{
|
||||||
|
uid = [self globallyUniqueObjectId];
|
||||||
|
[event setUid: uid];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
object = [SOGoAppointmentObject objectWithName: uid
|
object = [SOGoAppointmentObject objectWithName: uid
|
||||||
inContainer: self];
|
inContainer: self];
|
||||||
|
|
Loading…
Reference in New Issue