1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| diff --git a/src/bdrem/Renderer/Ical.php b/src/bdrem/Renderer/Ical.php
index 7383acc..13ca420 100644
--- a/src/bdrem/Renderer/Ical.php
+++ b/src/bdrem/Renderer/Ical.php
@@ -60,8 +60,10 @@ class Renderer_Ical extends Renderer
. '@bdrem';
$props['DTSTART;VALUE=DATE'] = str_replace('-', '', $event->localDate);
$props['DURATION'] = 'P1D';
- $props['SUMMARY'] = sprintf(
- '%s - %s. %s', $event->title, $event->age, $event->type
+ $props['SUMMARY'] = $this->escape(
+ sprintf(
+ '%s - %s. %s', $event->title, $event->age, $event->type
+ )
);
$props['END'] = 'VEVENT';
@@ -72,5 +74,14 @@ class Renderer_Ical extends Renderer
$s .= "END:VCALENDAR\n";
return $s;
}
+
+ protected function escape($str)
+ {
+ return str_replace(
+ array(',', ';'),
+ array('\\,', '\\;'),
+ $str
+ );
+ }
}
?>
|