Edgewall Software
Modify

Opened 20 years ago

Closed 20 years ago

Last modified 18 years ago

#259 closed defect (fixed)

trac.cgi breaks if called from a prefix-less URL (trivial fix included)

Reported by: pjd@… 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 Jonas Borgström, 20 years ago

Resolution: fixed
Status: newclosed

Ok, you're right. I've applied your patch in [419].

Thanks!

comment:2 by pjd@…, 20 years ago

Will this get included in the 0.6.2 release?

comment:3 by daniel, 20 years ago

Milestone: 0.6.20.7

comment:4 by anonymous, 18 years ago

hi there

Modify Ticket

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