Modify

Opened 9 years ago

Closed 6 years ago

#4920 closed defect (fixed)

img url incorrect if base_url includes trailing slash

Reported by: Michael Ching Owned by: Kamil Kisiel
Priority: normal Component: TracMathPlugin
Severity: normal Keywords:
Cc: Mitar Trac Release: 0.11

Description

The generated <img src=... tag includes an extra / if base_url includes a trailing slash.

Something like this resolves for us:

diff tracmath.py.orig tracmath.py 187c187,191 < result = '<img src="%s/tracmath/%s" alt="%s" />' % (req.base_url, imgname, content) ---

path = '/tracmath/' if req.base_url[-1] == '/':

path = 'tracmath/'

result = '<img src="%s%s%s" alt="%s" />' % (req.base_url, path, imgname, content)

Attachments (0)

Change History (3)

comment:1 Changed 9 years ago by Michael Ching

Forgot the code tags in initial ticket:

diff tracmath.py.orig tracmath.py
187c187,191
<         result = '<img src="%s/tracmath/%s" alt="%s" />' % (req.base_url, imgname, content)
---
>         path = '/tracmath/'
>         if req.base_url[-1] == '/':
>             path = 'tracmath/'
>
>         result = '<img src="%s%s%s" alt="%s" />' % (req.base_url, path, imgname, content)

comment:2 Changed 7 years ago by Kamil Kisiel

Owner: changed from rlotun to Kamil Kisiel
Status: newassigned

comment:3 Changed 6 years ago by Mitar

Cc: Mitar added; anonymous removed
Resolution: fixed
Status: assignedclosed

Fixed in 0.5.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Kamil Kisiel.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.