mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-13 15:57:12 +00:00
fix(calendar): truncate long UIDs to avoid SQL insert error
This commit is contained in:
1 parent
71b67259c6
commit
8cec92ea87
2 files changed
+4
-1
No files matched your search
@@ -3367,7 +3367,7 @@ firstInstanceCalendarDateRange: (NGCalendarDateRange *) fir
|
||||
// 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];
|
||||
|
||||
@@ -90,6 +90,9 @@
|
||||
startDate = [self startDate];
|
||||
endDate = [self endDate];
|
||||
uid = [self uid];
|
||||
if ([uid length] > 255)
|
||||
uid = [uid substringToIndex: 255];
|
||||
|
||||
title = [self summary];
|
||||
if (![title isNotNull])
|
||||
title = @"";
|
||||
|
||||
Reference in new issue
Block a user