Opened 18 years ago
Closed 16 years ago
#4379 closed defect (bug) (fixed)
Bad character in alt attribute of an img tag
Reported by: | orvar | Owned by: | westi |
---|---|---|---|
Milestone: | 2.7 | Priority: | high |
Severity: | normal | Version: | 2.2 |
Component: | Administration | Keywords: | has-patch tested |
Focuses: | Cc: |
Description
This is a repost of a ticket in WPMU trac: http://trac.mu.wordpress.org/ticket/294
If you put the character í (iacute) in the alt attribute of an img tag in a post (or use the inline uploader and put í in the title field) and save the post the character becomes corrupted. The second byte of the characters seems to be removed.
The error always occures in WPMU but only in WP if you are a non-admin user. The rest of the post is cut off in WP but in WPMU the result is a strange character (the initial byte plus whatever follows).
Attachments (1)
Change History (11)
#3
@
17 years ago
This doesn't appear to be happening as of [7290]. Tested as both admin and editor. Maybe TinyMCE 3.05 has fixed this?
#5
follow-up:
↓ 6
@
17 years ago
- Keywords has-patch tested added; needs-patch removed
- Milestone changed from 2.9 to 2.7
The problem is in kses, which strips \xad
, because it caues some problems with Opera. Accidentally the UTF-8 encoding of í is \xc3\xad
and half of it gets stripped, thus making it invalid UTF-8 character.
Attached is a patch, which replaces í with i in attributes.
#6
in reply to:
↑ 5
@
17 years ago
- Owner changed from anonymous to westi
- Status changed from new to assigned
Replying to nbachiyski:
The problem is in kses, which strips
\xad
, because it caues some problems with Opera. Accidentally the UTF-8 encoding of í is\xc3\xad
and half of it gets stripped, thus making it invalid UTF-8 character.
Attached is a patch, which replaces í with i in attributes.
The patch seems invisible to me ;-)
#7
@
17 years ago
Trac needs me to actually upload the patch?! I wrote a decent description of the functionality -- couldn't it write it itself? :-)
It is attached now.
#8
@
17 years ago
There have been reports of this breaking some Japanese characters too. Do we need the more general fix in #5917? I have some issues with the particular patch on that ticket, but the overall method might be worthwhile.
Tested using revision 7236.
Was able to reproduce the problem. Does not affect an admin user.