Replace '/' by '-' in filenames of attachments

Fixes #2537
This commit is contained in:
Francis Lachapelle
2014-02-07 14:00:36 -05:00
parent eee5beb698
commit 7118bbe0ab
3 changed files with 13 additions and 4 deletions
+5 -1
View File
@@ -267,7 +267,11 @@
NSString *extension;
filename = [NSMutableString stringWithString: [self filename]];
if (![filename length])
if ([filename length])
// We replace any slash by a dash since Apache won't allow encoded slashes by default.
// See http://httpd.apache.org/docs/2.2/mod/core.html#allowencodedslashes
filename = [filename stringByReplacingString: @"/" withString: @"-"];
else
[filename appendFormat: @"%@-%@",
[self labelForKey: @"Untitled"],
[bodyPart nameInContainer]];