diff --git a/ChangeLog b/ChangeLog index 60ca418f7..9a59d9c76 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,11 @@ * SoObjects/SOGo/SOGoUserFolder.m Improve the comparison of strings by rather using URL objects. + * SOPE/NGCards/CardVersitRenderer.m + We now properly quote attribute values if they + contain an ':' in them + * SoObjects/Appointments/iCalPerson+SOGo.m + Fixed the check for quoted SENT-BY 2008-11-11 Ludovic Marcotte diff --git a/SOPE/NGCards/CardVersitRenderer.m b/SOPE/NGCards/CardVersitRenderer.m index 049ae78b5..6714ce09f 100644 --- a/SOPE/NGCards/CardVersitRenderer.m +++ b/SOPE/NGCards/CardVersitRenderer.m @@ -78,10 +78,29 @@ key = [keys nextObject]; while (key) { + NSString *s; + int i, c; + renderedAttrs = [[attributes objectForKey: key] renderedForCards]; - [rendering appendFormat: @";%@=%@", - [key uppercaseString], - [renderedAttrs componentsJoinedByString: @","]]; + [rendering appendFormat: @";%@=", [key uppercaseString]]; + c = [renderedAttrs count]; + + for (i = 0; i < c; i++) + { + s = [renderedAttrs objectAtIndex: i]; + + // We MUST quote attribute values that have a ":" in them and that + // not already quoted + if ([s length] > 2 && [s rangeOfString: @":"].length && + [s characterAtIndex: 0] != '"' && ![s hasSuffix: @"\""]) + s = [NSString stringWithFormat: @"\"%@\"", s]; + + [rendering appendFormat: @"%@", s]; + + if (i+1 < c) + [rendering appendString: @","]; + } + key = [keys nextObject]; } diff --git a/SoObjects/Appointments/iCalPerson+SOGo.m b/SoObjects/Appointments/iCalPerson+SOGo.m index 224802de8..ff6a79bcd 100644 --- a/SoObjects/Appointments/iCalPerson+SOGo.m +++ b/SoObjects/Appointments/iCalPerson+SOGo.m @@ -67,7 +67,7 @@ static LDAPUserManager *um = nil; if ([mail length] > 7) { - if ([mail characterAtIndex: 0] && [mail hasSuffix: @"\""]) + if ([mail characterAtIndex: 0] == '"' && [mail hasSuffix: @"\""]) mail = [mail substringWithRange: NSMakeRange(1, [mail length]-2)]; return [mail substringFromIndex: 7];