Opened 18 years ago
Closed 17 years ago
#4388 closed defect (worksforme)
[PATCH] Double quote in attachment summary = Image macro failure
Reported by: | anonymous | Owned by: | Jonas Borgström |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.10.1 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
- Attach an image file [to a wiki page].
- Attempt to display that image via, i.e.
[[Image(filename.png)]]
If the summary of that attachment contains a double-quote, the image tag will be completely suppressed. (An over-sanitation of attempting to put the summary into the alt/title?)
Suggested resolution: escape " to "
As discussed here: http://groups.google.com/group/trac-users/browse_thread/thread/a44874225153cf1d
Attachments (2)
Change History (10)
comment:1 by , 18 years ago
Summary: | Double quote in attachment summary = Image macro failure → [PATCH] Double quote in attachment summary = Image macro failure |
---|
by , 18 years ago
Attachment: | image_macro_quotes_test_r4547.diff added |
---|
Test case for embedded quotes in title
comment:2 by , 18 years ago
Milestone: | → 0.10.4 |
---|
comment:4 by , 17 years ago
Oops, that last comment should have been: #5318 was marked as a duplicate of this ticket
comment:5 by , 17 years ago
Hrm I've had to do manual sanitizing in other macros (to block <script> etc..); perhaps we should be clear about where it's getting sanitized in this case?
Is it in the way the title is fetched? To be satisfied of this I'd really like a comment or something so nobody looking at this in isolation says "hang on a second! where's the sanitization?"
If we're not clear where it's sanitized then I'd prefer to blank out questionable characters to make sure more things "pass" than remove the sanitize() call.
comment:7 by , 17 years ago
This is no longer a problem with current 0.11b1+ from my testing.
Seeing this ticket actually has a patch (that I haven't looked at), I think either some dev should grab this ticket for fix in 0.10-stable, or I propose 'worksforme' with recommended solution to upgrade.
comment:8 by , 17 years ago
Milestone: | 0.10.5 |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
Upgrading should be preferred, yes.
The Image macro calls
sanitize()
on the resulting markup, and the tag ends up being removed. Removing the call to sanitize, i.e. inmacros.py
:Will results in:
So the quotes are properly escaped, but the sanitizing removes the result. As far as I know, manual sanitizing of this sort has not been necessary for a good while now.