Opened 14 years ago
Closed 13 years ago
#14996 closed defect (bug) (fixed)
Inserting an video/audio/media with an apostrophe in the title results in \' in the HTML
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.3 | Priority: | normal |
Severity: | normal | Version: | 3.0.1 |
Component: | Administration | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
If you insert a link using the Video, Audio, or Media buttons (note the Image button) and the Title has an apostrophe, the apostrophe is escaped with a slash.
e.g.
Video URL: http://my.awesomevideo.com/video
Title: Lew's Awesome Video
<a href="http://my.awesomevideo.com/video">Lew\'s Awesome Video</a>
Seems related to an old (already fixed) bug #6414
Attachments (3)
Change History (13)
#1
@
14 years ago
The proper fix here would probably be to entity-encode the html special chars. This will also produce valid HTML when > and < are entered.
#2
@
14 years ago
The > < chars are already fine already...
Only the quotes are being escaped and it looks like it is part of $_POST[insertonly][title]...
esc_attr is already being applied, but I think because the quotes are already escaped it isn't trying to convert them. I tried switching to esc_html and htmlspecialchars with no difference.
So this:
Lew's >, <, & "quote"
becomes:
Lew\'s >, <, & \"quote\"
If I don't stripslashes.
#3
@
14 years ago
- Keywords commit 3.2-early added; needs-testing removed
- Milestone changed from Awaiting Review to Future Release
#4
@
14 years ago
- Cc mike.schroder@… added
- Keywords reporter-feedback added
Can you double-check to see if this is still a problem for you?
I'm not able to reproduce the issue on 3.2.1 or trunk -- perhaps it has been since fixed?
#5
@
14 years ago
I can reproduce on trunk by clicking Add Video > From URL and putting the values mentioned in the ticket into the fields.
@
14 years ago
Got rid of the coding standards tabbing fix, since there are a lot more instances. That'll be for a different patch.
#6
@
14 years ago
- Keywords reporter-feedback removed
You're correct! Apparently I tried every method of inserting but that one.
Patch works as advertised -- refreshed the patch to current code, and to get rid of the extra tabs added by the newlines in the patch.
#9
@
13 years ago
Patch need refresh. 3.3 seems to have additional problems:
PHP Notice: Undefined index: insertonly in /trunk/wp-admin/includes/media.php on line 515, referer: http://localhost/trunk/wp-admin/media-upload.php?post_id=2507&tab=type_url PHP Notice: Undefined index: insertonly in /trunk/wp-admin/includes/media.php on line 520, referer: http://localhost/trunk/wp-admin/media-upload.php?post_id=2507&tab=type_url PHP Notice: Undefined variable: html in /trunk/wp-admin/includes/media.php on line 532, referer: http://localhost/trunk/wp-admin/media-upload.php?post_id=2507&tab=type_url
stripslashes from $_POSTinstertonly?title?