diff options
author | Allen Winter <allen.winter@kdab.com> | 2022-10-25 15:35:48 -0400 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2022-10-25 15:35:48 -0400 |
commit | 3267a80eb14093b23c4b089799c31646f2053ea6 (patch) | |
tree | 1d476c67caea72f1905ccadad1afd403c8dce622 | |
parent | 6daf22f3a3bb1c977d64a1fc3896d5beb415277b (diff) | |
parent | edc25b84eef1fcebab18269a3632be0d86fd2199 (diff) | |
download | libical-git-3267a80eb14093b23c4b089799c31646f2053ea6.tar.gz |
Merge branch '3.0'
-rw-r--r-- | .mdlrc.rb | 1 | ||||
-rw-r--r-- | .pre-commit-config.yaml | 2 | ||||
-rw-r--r-- | ReleaseNotes.txt | 3 | ||||
-rw-r--r-- | src/libical/icalvalue.c | 3 | ||||
-rw-r--r-- | src/test/regression.c | 20 |
5 files changed, 24 insertions, 5 deletions
@@ -1,4 +1,5 @@ all +rule 'MD007', :indent => 2, :start_indented => false rule 'MD013', :line_length => 100, :tables => false rule 'MD029', :style => :ordered exclude_rule 'MD033' diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index afb2fe75..365a23fe 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -37,7 +37,7 @@ repos: - id: cmake-lint exclude: (cmake/Toolchain-|.h.cmake|/Doxyfile.cmake) - repo: https://github.com/markdownlint/markdownlint - rev: v0.11.0 + rev: v0.12.0 hooks: - id: markdownlint entry: mdl diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 9d6a086c..d4d2dbed 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -57,11 +57,12 @@ Version 3.1.0 (NOT RELEASED YET): Version 3.0.17 (UNRELEASED): ---------------------------- * Improved Android support + * Escape commas in x-property TEXT values Version 3.0.16 (17 October 2022): --------------------------------- * Fix regressions in 3.0.15 due to improperly tested fuzz fixes - * Fix argument guards in icaltime_as_timet to match documentation and tests. + * Fix argument guards in icaltime_as_timet to match documentation and tests Version 3.0.15 (06 October 2022): --------------------------------- 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; |