Modify ↓
#259 closed defect (fixed)
trac.cgi breaks if called from a prefix-less URL (trivial fix included)
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | 0.7 |
Component: | general | Version: | 0.6.1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
With an Apache VirtualHost entry looking something like this:
<VirtualHost *> ServerName trac.example.org [...] ScriptAlias / /usr/local/share/trac/cgi-bin/trac.cgi/ <Location /> SetEnv TRAC_DB /home/trac/example.db </Location> </VirtualHost>
…trac dies with an IndexError in href_join() in source:trac/util.py.
Problem:
href_join() assumes all its arguments have a non-zero length.
Fix:
--- trac/util.py.orig Mon Mar 29 13:15:48 2004 +++ trac/util.py Fri Apr 16 16:52:21 2004 @@ -86,11 +86,7 @@ def href_join(u1, *tail): for u2 in tail: - if u1[-1] == '/' and u2[0] != '/' or \ - u1[-1] != '/' and u2[0] == '/': - u1 = u1 + u2 - else: - u1 = u1 + '/' + u2 + u1 = u1.rstrip('/') + '/' + u2.lstrip('/') return u1 def add_dictlist_to_hdf(list, hdf, prefix):
Attachments (0)
Change History (4)
comment:1 by , 21 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:3 by , 21 years ago
Milestone: | 0.6.2 → 0.7 |
---|
Note:
See TracTickets
for help on using tickets.
Ok, you're right. I've applied your patch in [419].
Thanks!