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

This commit is contained in:
Ludovic Marcotte
2017-07-13 10:45:18 -04:00
parent 00948f5753
commit 12993e45be
2 changed files with 9 additions and 1 deletions
+8 -1
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])