(fix) avoid escaping values that are quoted (fixes #3296)
parent
bfb7fa2e14
commit
17afe7c077
|
@ -53,10 +53,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];
|
||||
|
|
|
@ -206,7 +206,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"];
|
||||
|
|
Loading…
Reference in New Issue