View Issue Details

IDProjectCategoryView StatusLast Update
0002151SOGoSOPEpublic2014-09-12 15:27
Reporteryarook Assigned Toludovic  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionsuspended 
Product Versionnightly v2 
Target Versionsoon 
Summary0002151: iCal property parameter values are not escaped properly
Description

When an attendee whose CN contains a comma is added to an event the CN property value explodes with backslashes when the event created in SOGo is updated using first Thunderbird and then SOGo and so on. The same problem appears if the CN value contains a semicolon. With a colon the problem does not exist as the CN property value is quoted and interpreted properly by Thunderbird.

SOPE/NGCards/NSDictionary+NGCards.m:58 quotes property parameter values if they contain a colon

The proposed solution is that the same should apply to values that contain a semicolon or a comma

SOPE/NGCards/NSString+NGCards escapedForCards should then also be modified to avoid escaping those chars with backslashes if they are already quoted

TagsNo tags attached.

Activities

ludovic

ludovic

2013-04-05 17:41

administrator   ~0005484

Please try this patch:

--- a/SOPE/NGCards/NSDictionary+NGCards.m
+++ b/SOPE/NGCards/NSDictionary+NGCards.m
@@ -56,7 +56,7 @@
/ We MUST quote attribute values that have a ":" in them
and that not already quoted
/
if (asAttributes && [subValue length] > 2

  • && [subValue rangeOfString: @":"].length
  • && ([subValue rangeOfString: @":"].length || [subValue rangeOfString: @";"].length || [subValue rangeOfString: @","].length)
    && [subValue characterAtIndex: 0] != '"'
    && ![subValue hasSuffix: @"\""])
    subValue = [NSString stringWithFormat: @"\"%@\"", subValue];
    diff --git a/SOPE/NGCards/NSString+NGCards.m b/SOPE/NGCards/NSString+NGCards.m
    index 49c0a57..40bb3a9 100644
    --- a/SOPE/NGCards/NSString+NGCards.m
    +++ b/SOPE/NGCards/NSString+NGCards.m
    @@ -159,12 +159,12 @@

    string = [self stringByReplacingString: @"\"
    withString: @"\\"];

  • string = [string stringByReplacingString: @","
  • withString: @"\,"];
  • //string = [string stringByReplacingString: @","
  • // withString: @"\,"];
    // string = [string stringByReplacingString: @":"
    // withString: @"\:"];
  • string = [string stringByReplacingString: @";"
  • withString: @"\;"];
  • //string = [string stringByReplacingString: @";"
  • // withString: @"\;"];
    string = [string stringByReplacingString: @"\n"
    withString: @"\n"];
    string = [string stringByReplacingString: @"\r"
ludovic

ludovic

2013-04-10 15:52

administrator   ~0005506

Any updates on this?

Issue History

Date Modified Username Field Change
2012-12-19 13:46 yarook New Issue
2013-03-15 20:12 ludovic Target Version => 2.0.5
2013-04-05 17:41 ludovic Note Added: 0005484
2013-04-10 15:52 ludovic Note Added: 0005506
2013-04-11 19:48 ludovic Target Version 2.0.5 => soon
2014-09-12 15:27 ludovic Status new => closed
2014-09-12 15:27 ludovic Assigned To => ludovic
2014-09-12 15:27 ludovic Resolution open => suspended