Ticket #4089 (closed defect: fixed)
Opened 5 years ago
Last modified 5 years ago
Ticket title double-escapes entities
| Reported by: | Tim Hatch <trac@…> | Owned by: | cmlenz |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11 |
| Component: | general | Version: | devel |
| Severity: | minor | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description
I have a ticket that contains a little ascii arrow "->" (i.e. hyphen followed by greater-than). This displays correctly in the timeline view, search, and in the page itself, (as -> in the source). It displays incorrectly in the title of /ticket/nnn (as -&gt; in the source). I tried to track it down, but I think it's buried somewhere deep in ticket/model.py, as ticket_view.html just references ticket.summary. Lines 95-96 in ticket/model.py look completely normal.
Attachments
Change History
comment:1 Changed 5 years ago by Tim Hatch <trac@…>
comment:2 Changed 5 years ago by Tim Hatch <trac@…>
Aha! After looking some more, I think it's perhaps related to lines 10-12 of templates/layout.html -- is select('title/text()') returning the escaped version, which is being re-escaped when used as text?
comment:3 Changed 5 years ago by cboos
- Component changed from ticket system to general
- Milestone set to 0.11
- Severity changed from normal to minor
Yes, this comes from the
<title py:with="title = unicode(select('title/text()'))">
line, the unicode() call in particular.
This was introduced by r3866, but nothing specific about the need for the unicode() call was written in the commit message. Maybe cmlenz could comment on this?
PS: Tim, you could use `...` Wiki syntax for inline code formatting, instead of the more verbose {{{...}}}.
comment:4 Changed 5 years ago by cmlenz
- Owner changed from jonas to cmlenz
- Status changed from new to assigned
I'll look into this.
(The unicode() there is necessary to flatten the event stream to a string, but there's probably a better way to do that.)
comment:5 Changed 5 years ago by cmlenz
- Resolution set to fixed
- Status changed from assigned to closed
Should be fixed in [4165].



Oh, forgot to mention that it's unescaped in the database: