mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-11 14:57:12 +00:00
Fixes for import/export
Monotone-Parent: 3e7ac334a4ea19aa4ec2dcbc525628005ca75fb7 Monotone-Revision: d124c012f70febcfcbb9a2b5d4f3a20a7a001d7a Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-09-09T13:31:45 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
1 parent
cb888a11ff
commit
c543b9e9a7
24 files changed
+687
-547
No files matched your search
@@ -384,4 +384,42 @@ static NSMutableCharacterSet *urlStartChars = nil;
|
||||
}
|
||||
#endif
|
||||
|
||||
static NSMutableCharacterSet *safeLDIFChars = nil;
|
||||
static NSMutableCharacterSet *safeLDIFStartChars = nil;
|
||||
|
||||
- (void) _initSafeLDIFChars
|
||||
{
|
||||
safeLDIFChars = [NSMutableCharacterSet new];
|
||||
[safeLDIFChars addCharactersInRange: NSMakeRange (0x01, 9)];
|
||||
[safeLDIFChars addCharactersInRange: NSMakeRange (0x0b, 2)];
|
||||
[safeLDIFChars addCharactersInRange: NSMakeRange (0x0e, 114)];
|
||||
|
||||
safeLDIFStartChars = [safeLDIFChars mutableCopy];
|
||||
[safeLDIFStartChars removeCharactersInString: @" :<"];
|
||||
}
|
||||
|
||||
- (BOOL) _isLDIFSafe
|
||||
{
|
||||
int count, max;
|
||||
BOOL rc;
|
||||
|
||||
if (!safeLDIFChars)
|
||||
[self _initSafeLDIFChars];
|
||||
|
||||
rc = YES;
|
||||
|
||||
max = [self length];
|
||||
if (max > 0)
|
||||
{
|
||||
if ([safeLDIFStartChars characterIsMember: [self characterAtIndex: 0]])
|
||||
for (count = 1; rc && count < max; count++)
|
||||
rc = [safeLDIFChars
|
||||
characterIsMember: [self characterAtIndex: count]];
|
||||
else
|
||||
rc = NO;
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user