[dev] icalendar event generation patch
Mike Cochrane
mike@graftonhall.co.nz
Fri, 6 Sep 2002 23:25:24 +1200
linebreaks shouldn't be removed, they should be encoded.
I just has a quick look at the RFC, here's a patch to try and see if it fixes
things. I'll leave it to someone else to commit this if it works. Line folding
needs to be added in this bit too.
- Mike :-)
Index: Data/icalendar.php
===================================================================
RCS file: /repository/horde/lib/Data/icalendar.php,v
retrieving revision 1.6
diff -r1.6 icalendar.php
97c97
< $val = str_replace("\n", '\n', $val);
---
> $val = preg_replace('(\r\n|\n|\r)', "\\n\r\n ", rtrim($val));
> ----- Message from kaalh@smol.org ---------
> Date: Fri, 6 Sep 2002 12:53:12 +0200
> From: KaalH! <kaalh@smol.org>
> Reply-To: KaalH! <kaalh@smol.org>
> Subject: [dev] icalendar event generation patch
> To: "dev@lists.horde.org" <dev@lists.horde.org>
>
> remove linebreaks from description.
>
> Index: Event.php
> ===================================================================
> RCS file: /repository/kronolith/lib/Event.php,v
> retrieving revision 1.35
> diff -u -r1.35 Event.php
> --- Event.php 6 Sep 2002 05:23:19 -0000 1.35
> +++ Event.php 6 Sep 2002 10:43:31 -0000
> @@ -72,7 +72,7 @@
> $vcs = &Data::singleton('icalendar');
> }
> $vcal['SUMMARY'] = $this->title;
> - $vcal['DESCRIPTION'] = $this->description;
> + $vcal['DESCRIPTION'] = str_replace("\n", "", $this->description);
> $vcal['DTSTART'] = $vcs->makeDate($this->start);
> $vcal['DTEND'] = $vcs->makeDate($this->end);
>
> ---------------------
>
> Another bug detected :
> the exported icalendar events have wrong time values (tested with tz +0200)
>
> --
> KaalH!
>
> --
> Horde developers mailing list
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: dev-unsubscribe@lists.horde.org
>
> ----- End message from kaalh@smol.org -----