mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-02-17 07:33:57 +00:00
(fix) avoid escaping values that are quoted (fixes #3296)
This commit is contained in:
@@ -51,10 +51,10 @@
|
||||
[aString appendString: @","];
|
||||
subValue = [self objectAtIndex: count];
|
||||
|
||||
/* We MUST quote attribute values that have a ":" in them
|
||||
/* We MUST quote attribute values that have a ":" or "," in them
|
||||
and that not already quoted */
|
||||
if (asAttributes && [subValue length] > 2
|
||||
&& [subValue rangeOfString: @":"].length
|
||||
&& ([subValue rangeOfString: @":"].length || [subValue rangeOfString: @","].length)
|
||||
&& [subValue characterAtIndex: 0] != '"'
|
||||
&& ![subValue hasSuffix: @"\""])
|
||||
subValue = [NSString stringWithFormat: @"\"%@\"", subValue];
|
||||
|
||||
@@ -204,7 +204,7 @@
|
||||
testEquals([element value: 0 ofAttribute: @"param1"], @"paramvalue1");
|
||||
testEquals([element value: 1 ofAttribute: @"param1"], @"paramvalue2");
|
||||
|
||||
versit = @"BEGIN:GROUP1\r\nELEMENT;PARAM1=paramvalue1\\, with comma:value\r\nEND:GROUP1";
|
||||
versit = @"BEGIN:GROUP1\r\nELEMENT;PARAM1=\"paramvalue1, with comma\":value\r\nEND:GROUP1";
|
||||
group = [CardGroup parseSingleFromSource: versit];
|
||||
testEquals([group versitString], versit);
|
||||
element = [group firstChildWithTag: @"element"];
|
||||
|
||||
Reference in New Issue
Block a user