mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-27 00:52:45 +00:00
(fix) avoid saving non-parsable events/tasks
This commit is contained in:
@@ -2503,6 +2503,14 @@ inRecurrenceExceptionsForEvent: (iCalEvent *) theEvent
|
||||
|
||||
rq = [_ctx request];
|
||||
rqCalendar = [iCalCalendar parseSingleFromSource: [rq contentAsString]];
|
||||
|
||||
// We are unable to parse the received calendar, we return right away
|
||||
// with a 400 error code.
|
||||
if (!rqCalendar)
|
||||
{
|
||||
return [NSException exceptionWithHTTPStatus: 400
|
||||
reason: @"Unable to parse event."];
|
||||
}
|
||||
|
||||
if (![self isNew])
|
||||
{
|
||||
|
||||
@@ -118,6 +118,15 @@
|
||||
|
||||
rq = [_ctx request];
|
||||
rqCalendar = [iCalCalendar parseSingleFromSource: [rq contentAsString]];
|
||||
|
||||
// We are unable to parse the received calendar, we return right away
|
||||
// with a 400 error code.
|
||||
if (!rqCalendar)
|
||||
{
|
||||
return [NSException exceptionWithHTTPStatus: 400
|
||||
reason: @"Unable to parse task."];
|
||||
}
|
||||
|
||||
[self adjustClassificationInRequestCalendar: rqCalendar];
|
||||
[rq setContent: [[rqCalendar versitString] dataUsingEncoding: [rq contentEncoding]]];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user