Edgewall Software

Opened 6 years ago

Closed 6 years ago

#12762 closed defect (fixed)

"[" character is stripped from filename in image macro

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.2.2
Component: wiki system Version:
Severity: minor Keywords: image
Cc: Branch:
Release Notes:

Fix incorrectly stripping [ and ] characters from the filename given to Image macro.

API Changes:
Internal Changes:

Description (last modified by Jun Omae)

I noticed [ character is stripped from filename in image macro at tags/trac-1.0.13/trac/wiki/macros.py@:602-603#L601:

        # parse filespec argument to get realm and id if contained.
        parts = [i.strip('''['"]''')
                 for i in self._split_filespec_re.split(filespec)[1::2]]

Should be:

-        parts = [i.strip('''['"]''')
+        parts = [i.strip('\'"')

Tried to attach [file.png and specify the file with image macro. I verified [[Image(#5153:[file.png)]] doesn't work in demo-1.0/ticket/5153.

This is a regression introduced in [11739] for #10562.

Attachments (0)

Change History (3)

comment:1 by Jun Omae, 6 years ago

Description: modified (diff)

comment:2 by Jun Omae, 6 years ago

Owner: set to Jun Omae
Release Notes: modified (diff)
Status: newassigned

comment:3 by Jun Omae, 6 years ago

Resolution: fixed
Status: assignedclosed

Fixed in [15827] and merged in [15828].

Modify Ticket

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