Edgewall Software
Modify

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#7530 closed defect (wontfix)

'a href' and 'a name' tags don't allow colons

Reported by: twile Owned by: Remy Blank
Priority: normal Milestone:
Component: web frontend Version: 0.11rc2
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

When using the html WikiProcessor the href and name tags do not work with colons. You can see the example below.

Link With Colon
Link Without Colon

Colon doesn't work
No Colon does work

System Setup:
Trac: 0.11rc2
Python: 2.5.1 (r251:54863, Mar 7 2008, 04:14:33) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)]
setuptools: 0.6c6
SQLite: 3.4.2
pysqlite: 2.3.2
Genshi: 0.5.1
mod_python: 3.3.1
jQuery: 1.2.3

Attachments (0)

Change History (5)

comment:1 by ebray, 16 years ago

Seems to work for me right here on this site. Can you give an example of the HTML you're trying to use?

comment:2 by Remy Blank, 16 years ago

Milestone: 0.11.3
Owner: set to Remy Blank

Here's the HTML used in the ticket description:

{{{
#!html
<a href="#::Link_with_colon">Link With Colon</a><br>
<a href="#Link_without_colon">Link Without Colon</a><br><br>
<a name="::Link_with_colon">Colon doesn't work</a><br>
<a name="Link_without_colon">No Colon does work</a><br>
}}}

Indeed, the first link does not appear as a link. The generated HTML is:

<a>Link With Colon</a><br />
<a href="#Link_without_colon">Link Without Colon</a><br /><br />
<a name="::Link_with_colon">Colon doesn't work</a><br />
<a name="Link_without_colon">No Colon does work</a><br />

However, contrary to what the ticket description claims, the name= attribute works with colons.

This looks like an HTML sanitization bug.

comment:3 by Remy Blank, 16 years ago

Resolution: wontfix
Status: newclosed

Yes, it's a bug in Genshi, more specifically in genshi.filters.html.HTMLSanitizer.

The filter checks attributes supposed to contain URIs (like href=) for safe URIs. The check is done in HTMLSanitizer.is_safe_uri(). It is too simplistic, though: it splits the URI at the first ':' and checks the first half against a list of schemes. This is not correct for relative URIs containing a ':'.

Instead, it should first verify that the scheme conforms to RFC-3986, that is:

scheme        = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )

Anyway, this is not a bug in Trac.

comment:4 by Remy Blank, 16 years ago

The issue has been filed as #G274.

comment:5 by Remy Blank, 16 years ago

Milestone: 0.11.3

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Remy Blank.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Remy Blank 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.