Modify

Opened 5 years ago

Closed 3 years ago

#4920 closed defect (fixed)

img url incorrect if base_url includes trailing slash

Reported by: mkc Owned by: kisielk
Priority: normal Component: TracMathPlugin
Severity: normal Keywords:
Cc: mmitar@… 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 5 years ago by mkc

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 4 years ago by kisielk

  • Owner changed from rlotun to kisielk
  • Status changed from new to assigned

comment:3 Changed 3 years ago by mitar

  • Cc mmitar@… added
  • Resolution set to fixed
  • Status changed from assigned to closed

Fixed in 0.5.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from kisielk. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.