Opened 16 years ago
Last modified 14 months ago
#7617 new defect
Various ticket fields don't like leading or trailing /
Reported by: | Remy Blank | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | next-stable-1.6.x |
Component: | ticket system | Version: | 0.11.1 |
Severity: | minor | Keywords: | milestone |
Cc: | Ryan J Ollos | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
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 (0)
Change History (15)
comment:1 by , 16 years ago
comment:2 by , 16 years ago
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.
comment:3 by , 16 years ago
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?
comment:8 by , 13 years ago
When a ticket field that the name contains /../
or /./
, the milestone and admin link does not work (e.g. foo/../bar
).
I think that we should add a validation to the admin page.
comment:9 by , 11 years ago
Cc: | added |
---|
comment:10 by , 10 years ago
Milestone: | next-minor-0.12.x → next-stable-1.0.x |
---|
comment:11 by , 9 years ago
Owner: | removed |
---|
comment:13 by , 8 years ago
Milestone: | next-stable-1.0.x → next-stable-1.2.x |
---|
Moved ticket assigned to next-stable-1.0.x since maintenance of 1.0.x is coming to a close. Please move the ticket back if it's critical to fix on 1.0.x.
comment:14 by , 5 years ago
Milestone: | next-stable-1.2.x → next-stable-1.4.x |
---|
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.