escape the username part of the tablename in order to obtain an acceptable SQL identifier

This commit is contained in:
Wolfgang Sourdeau
2012-10-22 15:17:47 -04:00
parent 6d8c328910
commit 331b61d9b2

View File

@@ -37,6 +37,7 @@
#import <SOGo/SOGoDomainDefaults.h>
#import <SOGo/SOGoUser.h>
#import <SOGo/SOGoUserFolder.h>
#import <SOGo/NSString+Utilities.h>
#import <Mailer/SOGoMailAccount.h>
#import <Mailer/SOGoMailAccounts.h>
@@ -291,7 +292,8 @@ static NSMapTable *contextsTable = nil;
{
/* If "OCSFolderInfoURL" is properly configured, we must have 5
parts in this url. */
ocFSTableName = [NSString stringWithFormat: @"socfs_%@", username];
ocFSTableName = [NSString stringWithFormat: @"socfs_%@",
[username asCSSIdentifier]];
[parts replaceObjectAtIndex: 4 withObject: ocFSTableName];
folderTableURL
= [NSURL URLWithString: [parts componentsJoinedByString: @"/"]];