Opened 18 years ago
Closed 16 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: | johnconners | Owned by: | andy |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Administration | Version: | 3.0.1 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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
@
18 years ago
- Resolution → fixed
- Status new → closed
Yeah, this does indeed appear to have been fixed.
#10
@
18 years ago
- Milestone 2.7
- Resolution → worksforme
- Status reopened → 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.
#12
@
16 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
See different, but related, forum thread:
http://wordpress.org/support/topic/174164