Skip to content

Commit

Permalink
fix(calendar): truncate long UIDs to avoid SQL insert error
Browse files Browse the repository at this point in the history
  • Loading branch information
cgx committed Nov 17, 2021
1 parent 71b6725 commit 8cec92e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion SoObjects/Appointments/SOGoAppointmentFolder.m
Original file line number Diff line number Diff line change
Expand Up @@ -3367,7 +3367,7 @@ - (NSString *) importComponent: (iCalEntityObject *) event
// we generate a new UID based on a GUID
uid = [event uid];

if (![uid length] ||
if (![uid length] || [uid length] > 250 ||
[uid rangeOfCharacterFromSet: [NSCharacterSet characterSetWithCharactersInString: @"+/"]].location != NSNotFound)
{
uid = [self globallyUniqueObjectId];
Expand Down
3 changes: 3 additions & 0 deletions SoObjects/Appointments/iCalEvent+SOGo.m
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ - (NSMutableDictionary *) quickRecordFromContent: (NSString *) theContent
startDate = [self startDate];
endDate = [self endDate];
uid = [self uid];
if ([uid length] > 255)
uid = [uid substringToIndex: 255];

title = [self summary];
if (![title isNotNull])
title = @"";
Expand Down

0 comments on commit 8cec92e

Please sign in to comment.