(fix) fixed forwarding mails with attachments containing slashes in file names

pull/278/head
Ludovic Marcotte 2017-07-13 10:45:18 -04:00
parent 00948f5753
commit 12993e45be
2 changed files with 9 additions and 1 deletions

1
NEWS
View File

@ -6,6 +6,7 @@ New features
Bug fixes
- [web] use the organizer's alarm by default when accepting IMIP messages (#3934)
- [web] fixed forwarding mails with attachments containing slashes in file names
- [eas] don't include task folders if we hide them in SOGo (#4164)
- [core] not using cleaned data when sending mails (#4199)
- [core] don't update subscriptions when owner is not the active user (#3988)

View File

@ -1158,7 +1158,14 @@ static NSString *userAgent = nil;
name = [name substringFromIndex: r.location + 1];
if (![self isValidAttachmentName: name])
return [self invalidAttachmentNameError: name];
{
if ([name rangeOfString: @"/"].length)
{
name = [name stringByReplacingOccurrencesOfString: @"/" withString: @"-"];
}
else
return [self invalidAttachmentNameError: name];
}
p = [self pathToAttachmentWithName: name];
if (![_attach writeToFile: p atomically: YES])