Modify

Opened 18 years ago

Closed 17 years ago

#1545 closed defect (fixed)

Tag Index broken for Tag wiki pages with a tilte containing quotes

Reported by: anonymous Owned by: Alec Thomas
Priority: normal Component: TagsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.10

Description

Env: Trac 0.10.3, TracTags 0.4 (http://trac-hacks.org/svn/tagsplugin/trunk), Python 2.4

Example:

For the Tag AOP there exist a wiki page with the name AOP. The tag AOP than doesn't link to the normal tag list (trac.cgi/tags/'AOP'), but to the AOP wiki page (trac.cgi/wiki/AOP)

If the wiki page contains the title

= [wiki:"Aspect-Oriented Programming"] ([wiki:AOP]) =

the Tags page (trac.cgi/tags) is broken because the list entry becomes

<li><a rel="tag" title="[wiki:"Aspect-Oriented Programming"] ([wiki:AOP])  (4)" style="font-size: 11px" href="/cgi-bin/trac.cgi/wiki/AOP">AOP</a></li>

There is no error message in the log an the list entry is not visible in the HTML sources.

It happens in tractags/macros.py (around line 126) in out.write(...).

Maybe it would be sufficient to quote taginfo[tag][1]. A quick experiment with {{{urllib.quote()}} didn't yield the desired result.

Attachments (1)

1545_tags_quoted_title.patch (615 bytes) - added by John Hampton 18 years ago.
Patch to escape quotes in titles

Download all attachments as: .zip

Change History (5)

comment:1 Changed 18 years ago by Alec Thomas

Reporter: changed from claudius.link@… to anonymous

comment:2 Changed 18 years ago by anonymous

Applies as well to render_listtagged() in tractags/macros.py

Probably all occurrences of taginfo[tag][1] are at risk (if they are used as a quoted XML/HTML attribute)

Changed 18 years ago by John Hampton

Patch to escape quotes in titles

comment:3 Changed 18 years ago by John Hampton

OK, I attached a simple patch that converts double quotes to single quotes. It's not exactly ideal, but I don't think there is another solution. The biggest issue being that entities and escaped values aren't rendered in the tool tips.

Anyway, it works for me.

comment:4 Changed 17 years ago by Alec Thomas

Resolution: fixed
Status: newclosed

This is no longer an issue because page titles aren't rendered in 0.6.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Alec Thomas.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.