Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#3767 closed defect (fixed)

Roadmap iCalendar not compliant with rfc2445

Reported by: hvr@… Owned by: Christopher Lenz
Priority: normal Milestone: 0.10
Component: roadmap Version: 0.10rc1
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

according to http://www.ietf.org/rfc/rfc2445.txt (at least) the following requirements are not followed by the roadmap-generated iCalendar files, causing evolution-2.8 to ignore the VTODO items.

quoting from 4.8.4.7 Unique Identifier:

   Conformance: The property MUST be specified in the "VEVENT", "VTODO",
   "VJOURNAL" or "VFREEBUSY" calendar components.

quoting from 4.3.11 Text:

     text       = *(TSAFE-CHAR / ":" / DQUOTE / ESCAPED-CHAR)
     ; Folded according to description above

     ESCAPED-CHAR = "\\" / "\;" / "\," / "\N" / "\n")
        ; \\ encodes \, \N or \n encodes newline
        ; \; encodes ;, \, encodes ,

     TSAFE-CHAR = %x20-21 / %x23-2B / %x2D-39 / %x3C-5B
                  %x5D-7E / NON-US-ASCII
        ; Any character except CTLs not needed by the current
        ; character set, DQUOTE, ";", ":", "\", ","

Attachments (0)

Change History (6)

comment:1 by hvr@…, 18 years ago

The following patch against source:tags/trac-0.9.5/trac/ticket/roadmap.py fixes the defect for me

  • trac/ticket/roadmap.py

     
    209209                else: return 'CANCELLED'
    210210            else: return ''
    211211
     212        def escape_ics(text):
     213            s = ''.join(map(lambda c: (c in ";,\\") and '\\'+c or c, text))
     214            return '\\n'.join(re.split(r'[\r\n]+', s))
     215 
    212216        def write_prop(name, value, params={}):
    213217            text = ';'.join([name] + [k + '=' + v for k, v in params.items()]) \
    214                  + ':' + '\\n'.join(re.split(r'[\r\n]+', value))
     218                 + ':' + escape_ics(value)
    215219            firstline = 1
    216220            while text:
    217221                if not firstline: text = ' ' + text
     
    254258                           if ticket['owner'] == user]:
    255259                ticket = Ticket(self.env, tkt_id)
    256260                write_prop('BEGIN', 'VTODO')
     261                write_prop('UID', '<%s/ticket/%s@%s>' % (req.cgi_location,
     262                                                         tkt_id, host))
    257263                if milestone.has_key('due'):
    258264                    write_prop('RELATED-TO', uid)
    259265                    write_date('DUE', localtime(milestone['due']))

comment:2 by hvr@…, 18 years ago

Milestone: 0.10
Version: 0.9.50.10rc1

this applies to 0.10rc1 as well

comment:3 by Emmanuel Blot, 18 years ago

Milestone: 0.100.10.1

I really think we should stop adding non-critical bug fixes to 0.10.

comment:4 by hvr@…, 18 years ago

regenerated diff for RFC:2445 fix against current trunk:

  • trac/ticket/roadmap.py

     
    209209                else: return 'CANCELLED'
    210210            else: return ''
    211211
     212        def escape_ics(text):
     213            s = ''.join(map(lambda c: (c in ";,\\") and '\\'+c or c, text))
     214            return '\\n'.join(re.split(r'[\r\n]+', s))
     215
    212216        def write_prop(name, value, params={}):
    213217            text = ';'.join([name] + [k + '=' + v for k, v in params.items()]) \
    214                  + ':' + '\\n'.join(re.split(r'[\r\n]+', value))
     218                 + ':' + escape_ics(value)
    215219            firstline = 1
    216220            while text:
    217221                if not firstline: text = ' ' + text
     
    254258                           if ticket['owner'] == user]:
    255259                ticket = Ticket(self.env, tkt_id)
    256260                write_prop('BEGIN', 'VTODO')
     261                write_prop('UID', '<%s/ticket/%s@%s>' % (req.base_path,
     262                                                         tkt_id, host))
    257263                if milestone.has_key('due'):
    258264                    write_prop('RELATED-TO', uid)
    259265                    write_date('DUE', localtime(milestone['due']))

comment:5 by Christopher Lenz, 18 years ago

Milestone: 0.10.10.10
Status: newassigned

Patch looks good. Many thanks!

comment:6 by Christopher Lenz, 18 years ago

Resolution: fixed
Status: assignedclosed

Applied in [3793].

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christopher Lenz.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christopher Lenz to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.