Opened 17 years ago
Closed 15 years ago
#6414 closed defect (bug) (invalid)
Inserting an image with an apostrophe in the title or caption results in \' in the HTML
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0.1 |
Component: | Administration | Keywords: | |
Focuses: | Cc: |
Description
If you insert an image into a post and have an apostrophe in the title or caption, such as:
Title: It's a title Caption: It's a caption
Then the underlying HTML that ends up in the post will have the link's title attribute like so:
title="It\'s a title"
and the image's alt attribute as:
alt="It\'s a caption"
Note the addition of the backslash in both cases. This is as a result of the media_send_to_editor function (in wp-admin/includes/media.php) calling addslashes when it sends the HTML to the editor. I'm sure that addslashes is there for good reason so I suspect the fix might be somewhat trickier than simply removing the call.
Change History (16)
#8
@
16 years ago
- Resolution set to fixed
- Status changed from new to closed
Yeah, this does indeed appear to have been fixed.
#9
@
16 years ago
- Milestone changed from 2.9 to 2.7
- Resolution fixed deleted
- Status changed from closed to reopened
#10
@
16 years ago
- Milestone 2.7 deleted
- Resolution set to worksforme
- Status changed from reopened to closed
Should be moved to 2.6.2 if it was indeed fixed or if the behavior was changed naturally without knowledge of this ticket.
#11
@
15 years ago
- Cc codecowboy added
- Resolution worksforme deleted
- Status changed from closed to reopened
#12
@
15 years ago
This is still an issue in 3.0.1
When inserting a caption which requires apostrophe(s), you can insert it and update the post - the correct caption will be displayed on the public-facing post.
However, after updating the the post, the caption will not display correctly in either the visual editor or the media editor (it will be truncated at the first apostrophe). The temptation for a content editor is then to think that the caption is broken and re add it. Again, the editors do not display the updated caption.
See different, but related, forum thread:
http://wordpress.org/support/topic/174164