Monotone-Parent: 0dd43a8d058a214365a36681cd3df3b5c919b0f1
Monotone-Revision: f537b5805052d9a9bfb04e2f651abef055885f53 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-09-10T19:50:27 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
fab74a2801
commit
c966b00c70
|
@ -1,3 +1,10 @@
|
||||||
|
2008-09-10 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* SoObjects/Mailer/SOGoDraftObject.m ([SOGoDraftObject
|
||||||
|
-isValidAttachmentName:filename]): accept all filenames except
|
||||||
|
".", ".." and those that contain "/". Any other is valid and will
|
||||||
|
be accepted.
|
||||||
|
|
||||||
2008-09-08 Ludovic Marcotte <lmarcotte@inverse.ca>
|
2008-09-08 Ludovic Marcotte <lmarcotte@inverse.ca>
|
||||||
|
|
||||||
* SoObjects/SOGo/LDAPSource.m ([LDAPSource
|
* SoObjects/SOGo/LDAPSource.m ([LDAPSource
|
||||||
|
|
|
@ -719,23 +719,9 @@ static BOOL showTextAttachmentsInline = NO;
|
||||||
|
|
||||||
- (BOOL) isValidAttachmentName: (NSString *) filename
|
- (BOOL) isValidAttachmentName: (NSString *) filename
|
||||||
{
|
{
|
||||||
static NSString *sescape[] = { @"/", @"..", @"~", @"\"", @"'", nil };
|
return (!([filename rangeOfString: @"/"].length
|
||||||
unsigned int i;
|
|| [filename isEqualToString: @"."]
|
||||||
NSRange r;
|
|| [filename isEqualToString: @".."]));
|
||||||
BOOL result;
|
|
||||||
|
|
||||||
result = ([filename length] && ![filename hasPrefix: @"."]);
|
|
||||||
i = 0;
|
|
||||||
while (result && sescape[i])
|
|
||||||
{
|
|
||||||
r = [filename rangeOfString: sescape[i]];
|
|
||||||
if (r.length > 0)
|
|
||||||
result = NO;
|
|
||||||
else
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString *) pathToAttachmentWithName: (NSString *) _name
|
- (NSString *) pathToAttachmentWithName: (NSString *) _name
|
||||||
|
|
Loading…
Reference in a new issue