Skip Menu |

This queue is for tickets about the Data-ICal CPAN distribution.

Report information
The Basics
Id: 21354
Status: resolved
Priority: 0/
Queue: Data-ICal

People
Owner: Nobody in particular
Requestors: takeru.inoue [...] gamma.ocn.ne.jp
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.07
Fixed in: 0.07



Subject: PATCH: semicolons must not be escaped in the rrule property
This patch addresses semicolons appear in the recur type (ex. rrule property). Semicolons must not be escaped in the rrule property according to the iCalendar specifications. I can share my calendars with my colleagues by using this module. Thanks! Takeru
Subject: Property.pm.patch
--- Property.pm.orig 2006-01-24 23:36:29.000000000 +0900 +++ Property.pm 2006-09-07 02:43:07.000000000 +0900 @@ -77,7 +77,7 @@ my $self = shift; my $string = uc( $self->key ) . $self->_parameters_as_string . ":" - . $self->_value_as_string . "\n"; + . $self->_value_as_string($self->key) . "\n"; # Assumption: the only place in an iCalendar that needs folding are property # lines @@ -89,6 +89,7 @@ =head2 _value_as_string Returns the property's value as a string. +Semicolons are not escaped when the value is recur type (the key is rrule). Values are quoted according the ICal spec: L<http://www.kanzaki.com/docs/ical/text.html>. @@ -99,10 +100,11 @@ sub _value_as_string { my $self = shift; + my $key = shift; my $value = $self->value(); $value =~ s/\\/\\/gs; - $value =~ s/\Q;/\\;/gs; + $value =~ s/\Q;/\\;/gs unless lc($key) eq 'rrule'; $value =~ s/,/\\,/gs; $value =~ s/\n/\\n/gs; $value =~ s/\\N/\\N/gs;
CC: undisclosed-recipients: ;
Subject: Re: [rt.cpan.org #21354] PATCH: semicolons must not be escaped in the rrule property
Date: Wed, 6 Sep 2006 14:38:13 -0400
To: plank734 via RT <bug-Data-ICal [...] rt.cpan.org>
From: jesse <jesse [...] fsck.com>
Takeru, Thanks! Can you point me at the RFC section # I should reference in the change log? Show quoted text
> This patch addresses semicolons appear in the recur type (ex. rrule > property). Semicolons must not be escaped in the rrule property > according to the iCalendar specifications. > > I can share my calendars with my colleagues by using this module. > Thanks! > > Takeru
Show quoted text
> --- Property.pm.orig 2006-01-24 23:36:29.000000000 +0900 > +++ Property.pm 2006-09-07 02:43:07.000000000 +0900 > @@ -77,7 +77,7 @@ > my $self = shift; > my $string = uc( $self->key ) > . $self->_parameters_as_string . ":" > - . $self->_value_as_string . "\n"; > + . $self->_value_as_string($self->key) . "\n"; > > # Assumption: the only place in an iCalendar that needs folding are property > # lines > @@ -89,6 +89,7 @@ > =head2 _value_as_string > > Returns the property's value as a string. > +Semicolons are not escaped when the value is recur type (the key is rrule). > > Values are quoted according the ICal spec: > L<http://www.kanzaki.com/docs/ical/text.html>. > @@ -99,10 +100,11 @@ > > sub _value_as_string { > my $self = shift; > + my $key = shift; > my $value = $self->value(); > > $value =~ s/\\/\\/gs; > - $value =~ s/\Q;/\\;/gs; > + $value =~ s/\Q;/\\;/gs unless lc($key) eq 'rrule'; > $value =~ s/,/\\,/gs; > $value =~ s/\n/\\n/gs; > $value =~ s/\\N/\\N/gs;
--
From: takeru.inoue [...] gamma.ocn.ne.jp
The recur type is defined in section 4.3.10 in RFC2445. This type is separated by comma or semicolon as shown in "description" part of this section; | multiple "recur" values are specified by a COMMA character (US-ASCII decimal 44) separated list of values. | The rule parts are separated from each other by the SEMICOLON character (US-ASCII decimal 59). At the middle of this section, an example is presented; | RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-1 See http://www.kanzaki.com/docs/ical/recur.html In my patch presented the first bug report, SEMICOLON is only skipped. However, COMMA should be also skipped. I post another revised patch file. Best regards, Takeru On 水曜日 9月 06 14:38:19 2006, jesse@fsck.com wrote: Show quoted text
> Takeru, > > Thanks! Can you point me at the RFC section # I should reference in > the > change log? >
> > This patch addresses semicolons appear in the recur type (ex. rrule > > property). Semicolons must not be escaped in the rrule property > > according to the iCalendar specifications. > > > > I can share my calendars with my colleagues by using this module. > > Thanks! > > > > Takeru
>
> > --- Property.pm.orig 2006-01-24 23:36:29.000000000 +0900 > > +++ Property.pm 2006-09-07 02:43:07.000000000 +0900 > > @@ -77,7 +77,7 @@ > > my $self = shift; > > my $string = uc( $self->key ) > > . $self->_parameters_as_string . ":" > > - . $self->_value_as_string . "\n"; > > + . $self->_value_as_string($self->key) . "\n"; > > > > # Assumption: the only place in an iCalendar that needs folding
> are property
> > # lines > > @@ -89,6 +89,7 @@ > > =head2 _value_as_string > > > > Returns the property's value as a string. > > +Semicolons are not escaped when the value is recur type (the key
is Show quoted text
> rrule).
> > > > Values are quoted according the ICal spec: > > L<http://www.kanzaki.com/docs/ical/text.html>. > > @@ -99,10 +100,11 @@ > > > > sub _value_as_string { > > my $self = shift; > > + my $key = shift; > > my $value = $self->value(); > > > > $value =~ s/\\/\\/gs; > > - $value =~ s/\Q;/\\;/gs; > > + $value =~ s/\Q;/\\;/gs unless lc($key) eq 'rrule'; > > $value =~ s/,/\\,/gs; > > $value =~ s/\n/\\n/gs; > > $value =~ s/\\N/\\N/gs;
>
--- Property.pm.orig 2006-01-24 23:36:29.000000000 +0900 +++ Property.pm 2006-09-07 10:19:27.000000000 +0900 @@ -77,7 +77,7 @@ my $self = shift; my $string = uc( $self->key ) . $self->_parameters_as_string . ":" - . $self->_value_as_string . "\n"; + . $self->_value_as_string($self->key) . "\n"; # Assumption: the only place in an iCalendar that needs folding are property # lines @@ -89,6 +89,8 @@ =head2 _value_as_string Returns the property's value as a string. +Comma and semicolon are not escaped when the value is recur type (the key is +rrule). Values are quoted according the ICal spec: L<http://www.kanzaki.com/docs/ical/text.html>. @@ -99,11 +101,12 @@ sub _value_as_string { my $self = shift; + my $key = shift; my $value = $self->value(); $value =~ s/\\/\\/gs; - $value =~ s/\Q;/\\;/gs; - $value =~ s/,/\\,/gs; + $value =~ s/\Q;/\\;/gs unless lc($key) eq 'rrule'; + $value =~ s/,/\\,/gs unless lc($key) eq 'rrule'; $value =~ s/\n/\\n/gs; $value =~ s/\\N/\\N/gs;
From: JESSE [...] cpan.org
Thanks. Appled