Edgewall Software

Opened 7 years ago

Last modified 7 years ago

#12762 closed defect

"[" character is stripped from filename in image macro — at Version 2

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.

Change History (2)

comment:1 by Jun Omae, 7 years ago

Description: modified (diff)

comment:2 by Jun Omae, 7 years ago

Owner: set to Jun Omae
Release Notes: modified (diff)
Status: newassigned
Note: See TracTickets for help on using tickets.