Opened 6 years ago
Closed 5 years ago
#4379 closed defect (bug) (fixed)
Bad character in alt attribute of an img tag
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | high | Milestone: | 2.7 |
| Component: | Administration | Version: | 2.2 |
| Severity: | normal | Keywords: | has-patch tested |
| 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)
- Keywords needs-patch added
- Milestone changed from 2.3 (trunk) to 2.4 (future)
comment:2
MtDewVirus — 5 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?
comment:5
follow-up:
↓ 6
nbachiyski — 5 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.
- 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 ;-)
nbachiyski — 5 years ago
comment:7
nbachiyski — 5 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.
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.
#5917 looks like it might be a good idea.
Also it looks like the \xad stripping is done twice at the moment.
Forgive my lack of knowledge but is there somewhere I can read up on the Opera issue?
comment:10
ryan — 5 years ago
- Resolution set to fixed
- Status changed from assigned to closed
Fixed along with #5917

Tested using revision 7236.
Was able to reproduce the problem. Does not affect an admin user.