diff --git a/src/Generators/Ics.php b/src/Generators/Ics.php index 7730d3a..c0570fd 100644 --- a/src/Generators/Ics.php +++ b/src/Generators/Ics.php @@ -50,7 +50,7 @@ public function generate(Link $link): string } if ($link->description) { - $url[] = 'DESCRIPTION:'.strip_tags($link->description); + $url[] = 'DESCRIPTION:'.$this->escapeString(strip_tags($link->description)); } if ($link->address) { $url[] = 'LOCATION:'.$this->escapeString($link->address); diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_description_is_html_code_event_link_with_allday_flag__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_description_is_html_code_event_link_with_allday_flag__1.txt index d402c87..a5c7a11 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_description_is_html_code_event_link_with_allday_flag__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_description_is_html_code_event_link_with_allday_flag__1.txt @@ -7,14 +7,7 @@ SUMMARY:Birthday Party +1 DTSTAMP;TZID=UTC:20180201T090000 DTSTART;TZID=UTC:20180201T090000 DTEND;TZID=UTC:20180201T180000 -DESCRIPTION:With balloons, clowns and stuff -Bring a dog, bring a frog. -There will be line breaks on it. -Project link calendar-links - - -Thank you. - +DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog.\nThere will be line breaks on it.\nProject link calendar-links\n\n\nThank you.\n LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT END:VCALENDAR \ No newline at end of file diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link__1.txt index c7bfc9f..6473d64 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link__1.txt @@ -7,8 +7,7 @@ SUMMARY:New Year DTSTAMP;TZID=UTC:20191231T230000 DTSTART;TZID=UTC:20191231T230000 DTEND;TZID=UTC:20200101T010000 -DESCRIPTION:With balloons, clowns and stuff -Bring a dog, bring a frog +DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT END:VCALENDAR \ No newline at end of file diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link_with_allday_flag__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link_with_allday_flag__1.txt index 1833333..5d63b6b 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link_with_allday_flag__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link_with_allday_flag__1.txt @@ -7,8 +7,7 @@ SUMMARY:Birthday DTSTAMP;TZID=20180201 DTSTART:20180201 DURATION:P5D -DESCRIPTION:With balloons, clowns and stuff -Bring a dog, bring a frog +DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT END:VCALENDAR \ No newline at end of file diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_short_event_link__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_short_event_link__1.txt index 73b1047..dff2003 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_short_event_link__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_short_event_link__1.txt @@ -7,8 +7,7 @@ SUMMARY:Birthday DTSTAMP;TZID=UTC:20180201T090000 DTSTART;TZID=UTC:20180201T090000 DTEND;TZID=UTC:20180201T180000 -DESCRIPTION:With balloons, clowns and stuff -Bring a dog, bring a frog +DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT END:VCALENDAR \ No newline at end of file diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_single_day_allday_event_link__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_single_day_allday_event_link__1.txt index 5aca603..87feba4 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_single_day_allday_event_link__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_single_day_allday_event_link__1.txt @@ -7,8 +7,7 @@ SUMMARY:Birthday DTSTAMP;TZID=20180201 DTSTART:20180201 DURATION:P1D -DESCRIPTION:With balloons, clowns and stuff -Bring a dog, bring a frog +DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT END:VCALENDAR \ No newline at end of file diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_an_ics_link_with_custom_uid__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_an_ics_link_with_custom_uid__1.txt index 8a87e9b..1912759 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_an_ics_link_with_custom_uid__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_an_ics_link_with_custom_uid__1.txt @@ -7,8 +7,7 @@ SUMMARY:Birthday DTSTAMP;TZID=UTC:20180201T090000 DTSTART;TZID=UTC:20180201T090000 DTEND;TZID=UTC:20180201T180000 -DESCRIPTION:With balloons, clowns and stuff -Bring a dog, bring a frog +DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT END:VCALENDAR \ No newline at end of file diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_dtstamp__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_dtstamp__1.txt index 73b1047..dff2003 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_dtstamp__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_dtstamp__1.txt @@ -7,8 +7,7 @@ SUMMARY:Birthday DTSTAMP;TZID=UTC:20180201T090000 DTSTART;TZID=UTC:20180201T090000 DTEND;TZID=UTC:20180201T180000 -DESCRIPTION:With balloons, clowns and stuff -Bring a dog, bring a frog +DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT END:VCALENDAR \ No newline at end of file diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_id__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_id__1.txt index 73b1047..dff2003 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_id__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_id__1.txt @@ -7,8 +7,7 @@ SUMMARY:Birthday DTSTAMP;TZID=UTC:20180201T090000 DTSTART;TZID=UTC:20180201T090000 DTEND;TZID=UTC:20180201T180000 -DESCRIPTION:With balloons, clowns and stuff -Bring a dog, bring a frog +DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT END:VCALENDAR \ No newline at end of file