summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2022-10-25 15:35:48 -0400
committerAllen Winter <allen.winter@kdab.com>2022-10-25 15:35:48 -0400
commit3267a80eb14093b23c4b089799c31646f2053ea6 (patch)
tree1d476c67caea72f1905ccadad1afd403c8dce622 /src
parent6daf22f3a3bb1c977d64a1fc3896d5beb415277b (diff)
parentedc25b84eef1fcebab18269a3632be0d86fd2199 (diff)
downloadlibical-git-3267a80eb14093b23c4b089799c31646f2053ea6.tar.gz
Merge branch '3.0'
Diffstat (limited to 'src')
-rw-r--r--src/libical/icalvalue.c3
-rw-r--r--src/test/regression.c20
2 files changed, 20 insertions, 3 deletions
diff --git a/src/libical/icalvalue.c b/src/libical/icalvalue.c
index 9945f02f..e299edea 100644
--- a/src/libical/icalvalue.c
+++ b/src/libical/icalvalue.c
@@ -304,7 +304,8 @@ static char *icalmemory_strdup_and_quote(const icalvalue *value, const char *unq
(icalproperty_isa(value->parent) == ICAL_RESOURCES_PROPERTY) ||
(icalproperty_isa(value->parent) == ICAL_POLLPROPERTIES_PROPERTY) ||
(icalproperty_isa(value->parent) == ICAL_LOCATIONTYPE_PROPERTY) ||
- (icalproperty_isa(value->parent) == ICAL_X_PROPERTY)) {
+ ((icalproperty_isa(value->parent) == ICAL_X_PROPERTY) &&
+ icalvalue_isa(value) != ICAL_TEXT_VALUE)) {
icalmemory_append_char(&str, &str_p, &buf_sz, *p);
break;
}
diff --git a/src/test/regression.c b/src/test/regression.c
index 3d02469e..6c80a8cf 100644
--- a/src/test/regression.c
+++ b/src/test/regression.c
@@ -5209,8 +5209,9 @@ test_icalvalue_resets_timezone_on_set(void)
icalerror_clear_errno();
}
-static void test_remove_tzid_from_due(void)
+static void test_comma_in_xproperty(void)
{
+ // X-property value without explicit value type
icalproperty *xproperty = icalproperty_new_from_string("X-TEST-PROPERTY:test,test");
icalcomponent *c;
@@ -5225,9 +5226,24 @@ static void test_remove_tzid_from_due(void)
str_is("icalproperty_as_ical_string()", "X-TEST-PROPERTY:test,test\r\n", icalproperty_as_ical_string(icalcomponent_get_first_property(icalcomponent_get_inner(c), ICAL_X_PROPERTY)));
icalcomponent_free(c);
+
+ // X-property value with TEXT value type
+ xproperty = icalproperty_new_from_string("X-TEST-PROPERTY;VALUE=TEXT:test\\,test");
+
+ c = icalcomponent_vanew(
+ ICAL_VCALENDAR_COMPONENT,
+ icalcomponent_vanew(
+ ICAL_VEVENT_COMPONENT,
+ xproperty,
+ 0),
+ 0);
+
+ str_is("icalproperty_as_ical_string()", "X-TEST-PROPERTY;VALUE=TEXT:test\\,test\r\n", icalproperty_as_ical_string(icalcomponent_get_first_property(icalcomponent_get_inner(c), ICAL_X_PROPERTY)));
+
+ icalcomponent_free(c);
}
-static void test_comma_in_xproperty(void)
+static void test_remove_tzid_from_due(void)
{
icalproperty *due = icalproperty_vanew_due(icaltime_from_string("20220120T120000"), (void *)0);
icalcomponent *c;