From 77dad178d11b36da07660a9b5f0dd8c7a74cad50 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 10 Jun 2014 08:45:35 -0400 Subject: [PATCH] Make sure we don't have '-' in table names. --- ActiveSync/SOGoActiveSyncDispatcher.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ActiveSync/SOGoActiveSyncDispatcher.m b/ActiveSync/SOGoActiveSyncDispatcher.m index a6a9eb384..7f58e420a 100644 --- a/ActiveSync/SOGoActiveSyncDispatcher.m +++ b/ActiveSync/SOGoActiveSyncDispatcher.m @@ -1968,9 +1968,12 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. if ([parts count] == 5) { /* If "OCSFolderInfoURL" is properly configured, we must have 5 - parts in this url. */ + parts in this url. We strip the '-' character in case we have + this in the domain part - like foo@bar-zot.com */ ocFSTableName = [NSString stringWithFormat: @"sogo_cache_folder_%@", - [[user loginInDomain] asCSSIdentifier]]; + [[[user loginInDomain] asCSSIdentifier] + stringByReplacingOccurrencesOfString: @"-" + withString: @"_"]]; [parts replaceObjectAtIndex: 4 withObject: ocFSTableName]; folderTableURL = [NSURL URLWithString: [parts componentsJoinedByString: @"/"]];