Edgewall Software

Ticket #7617 (new defect)

Opened 4 months ago

Last modified 4 months ago

Various ticket fields don't like leading or trailing /

Reported by: rblank Owned by: rblank
Priority: low Milestone: 0.11-retriage
Component: ticket system Version: 0.11.1
Severity: minor Keywords: milestone
Cc:

Description

As an example, create a milestone where the name either starts or ends with a /. It will be visible in the roadmap, but clicking on the link will lead to an error, saying that the milestone cannot be found. The same problem applies to other enumerated fields like components, priorities or versions, when edited in the admin module.

The problem is due to the roadmap module creating links to milestones using req.href.milestone(milestone_name), and href stripping leading and trailing slashes at this location. The same analysis applies to the admin module.

I'm not sure if the solution is to build the milestone and admin links differently, or to remove the automatic stripping in Href. Opinions welcome.

Attachments

Change History

Changed 4 months ago by cboos

Same issue for Wiki page names, one could eventually create (programatically) a WikiPageName ending with a '/', but we won't be able to access it through the web interface, because of the redirect.

The only difference is that the web interface prevent creating such Wiki pages, but allows it for Milestones. So I think we should keep the links as they are and add some safeguards (i.e. strip trailing '/') when creating the milestones.

Changed 4 months ago by rblank

There's another reason why trailing slashes are forbidden in wiki page names: the attachments module displays the list of attachments for a wiki page- (or any other resource) when the URL has a trailing slash, like /attachments/wiki/WikiStart/. AFAIK, this is the only location in Trac where a trailing / is significant.

I don't think it is necessary to strip the slashes in milestone and other enum values. I have tried an experimental patch where the links are constructed so that the / are not stripped, and this fixes the problem (and everything else continues working). But I may be missing something.

Changed 4 months ago by rblank

BTW, shouldn't resource names containing arbitrary characters be passed as query arguments, like /milestone?name=My%20milestone ? Or does this break some kind of hierarchy convention?

Changed 4 months ago by rblank

Closed #6303 as a duplicate.

Add/Change #7617 (Various ticket fields don't like leading or trailing /)

Author



Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will change from rblank. Next status will be 'new'
The owner will change from rblank to anonymous. Next status will be 'assigned'
 
Note: See TracTickets for help on using tickets.