Opened 17 years ago
Closed 17 years ago
#6992 closed defect (fixed)
Spaces not accepted in file names under htdocs
Reported by: | anonymous | Owned by: | Christopher Lenz |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | web frontend/mod_python | Version: | devel |
Severity: | blocker | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Problem: Trac does not allow spaces in files located in htdocs.
Cause: the method match_request() in trunk/trac/web/chrome.py has a regexp that filters the file name but stops at the first occurence of a space, thus a link to htdocs:File 1.jpg becomes /chrome/site/File instead of /chrome/site/File 1.jpg. The URL is being escaped by the browser, but gets unescaped by trac before it hits match_request().
Suggested fixes:
- Allow spaces by extending the regular expression or
- Prohibit spaces (in alignment with wiki page names), but throw an according error message (along the lines of "No spaces allowed in files").
The first solution has the problem that spaces need to be escaped with %20 manually in wiki links, since htdocs:File 1.jpg will yield "1.jpg" (1.jpg being interpreted as a description and File%201.jpg looks ugly).
Attachments (1)
Change History (6)
comment:1 by , 17 years ago
Summary: | Spaces not accepted in file names underhtdocs → Spaces not accepted in file names under htdocs |
---|
follow-up: 3 comment:2 by , 17 years ago
comment:3 by , 17 years ago
Replying to thatch:
Actually there is syntax for allowing spaces in wikilinks… htdocs:"File 1.jpg"
Interesting, thanks. Unfortunally that doesn't solve the problem itself. So we still need to know how to go about this.
comment:4 by , 17 years ago
The above patch was suggested by cmlenz and thatch and tested by me. It solves this issue. Please apply.
comment:5 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Patch applied in [6736]. Thanks danimo
Actually there is syntax for allowing spaces in wikilinks… htdocs:"File 1.jpg"