Opened 18 years ago
Closed 14 years ago
#3946 closed defect (fixed)
iCalendar export: no URL encoding in URL Property
Reported by: | Owned by: | osimons | |
---|---|---|---|
Priority: | normal | Milestone: | 0.12.1 |
Component: | roadmap | Version: | 0.10b1 |
Severity: | minor | Keywords: | ical verify bitesized |
Cc: | lists@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
When using whitespace (or other special characters) in milestone names (e.g. "M001 KW42") and exporting the roadmap via iCalendar, the URL property should contain an URL encoded value.
E.g.
URL:http://some.host/trac/milestone/M001%20KW42
instead of
URL:http://some.host/trac/milestone/M001 KW42
Attachments (1)
Change History (10)
comment:1 by , 18 years ago
Component: | general → roadmap |
---|---|
Keywords: | ical verify added |
Milestone: | → 0.12 |
Owner: | changed from | to
Severity: | normal → minor |
comment:2 by , 14 years ago
Keywords: | bitesized added |
---|---|
Milestone: | next-major-0.1X → unscheduled |
comment:3 by , 14 years ago
Cc: | added |
---|
Confirmed, content below, but the browser redirects to the correct url though..
BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Edgewall Software//NONSGML Trac 0.12.1dev-r10147//EN METHOD:PUBLISH X-WR-CALNAME:My Project - Roadmap BEGIN:VEVENT UID:</milestone/M001 KW42@localhost:8080> DTSTAMP:20110929T160000Z DTSTART;VALUE=DATE:20110929 SUMMARY:Milestone M001 KW42 URL:http://localhost:8080/milestone/M001 KW42 END:VEVENT END:VCALENDAR
comment:4 by , 14 years ago
Milestone: | unscheduled → 0.12.1 |
---|---|
Owner: | changed from | to
I had a look at the code, and it looks wrong - much like the code goes out of its way to avoid encoding? Anyway, if we treat it like any other URL it should be fine:
-
0.12-stable/trac/ticket/roadmap.py
444 444 write_date('DTSTART', milestone.due) 445 445 write_prop('SUMMARY', _('Milestone %(name)s', 446 446 name=milestone.name)) 447 write_prop('URL', req.base_url + '/milestone/' + 448 milestone.name) 447 write_prop('URL', req.abs_href.milestone(milestone.name) 449 448 if milestone.description: 450 449 write_prop('DESCRIPTION', milestone.description) 451 450 write_prop('END', 'VEVENT')
I've searched rfc:2445 for information, but it says nothing apart from identifying it as a URL - leaving it to regular handling. Like we do through a Href()
instance.
Could you test the patch?
comment:5 by , 14 years ago
ahh.. i came up with:
-
trac/ticket/roadmap.py
17 17 18 18 from StringIO import StringIO 19 19 from datetime import datetime, timedelta 20 from urllib import quote 20 21 import re 21 22 22 23 from genshi.builder import tag … … 445 446 write_prop('SUMMARY', _('Milestone %(name)s', 446 447 name=milestone.name)) 447 448 write_prop('URL', req.base_url + '/milestone/' + 448 milestone.name)449 quote(milestone.name)) 449 450 if milestone.description: 450 451 write_prop('DESCRIPTION', milestone.description) 451 452 write_prop('END', 'VEVENT')
I also couldn't find anything special about the URL, or whether the url part in the UID should contain be quoted or not. I'll test your patch.
producing:
BEGIN:VCALENDAR VERSION:2.0 PRODID:-//Edgewall Software//NONSGML Trac 0.12.1dev-r10147//EN METHOD:PUBLISH X-WR-CALNAME:My Project - Roadmap BEGIN:VEVENT UID:</milestone/M001 KW42@localhost:8080> DTSTAMP:20110929T160000Z DTSTART;VALUE=DATE:20110929 SUMMARY:Milestone M001 KW42 URL:http://localhost:8080/milestone/M001%20KW42 END:VEVENT END:VCALENDAR
by , 14 years ago
Attachment: | abs_href.patch added |
---|
comment:6 by , 14 years ago
Your patch was missing a ')' at the end but worked fine, cheers. I attached an updated version of the patch.
comment:7 by , 14 years ago
Oops - mistakes do happen :-) Thanks for testing.
Now that this serious issue of the patch quality itself is under control, I do not see this as a high impact or high risk change. I'd like to just commit this now for 0.12.1 unless anyone objects.
comment:9 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
PatchWelcome