#2393 closed defect (bug) (fixed)
Encoding problem while uploader is used
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 2.0.2 |
| Component: | General | Keywords: | bg|has-patch |
| Focuses: | Cc: |
Description
When I use the upoader to upload my image and write the title and the description in Russian, the "alt" attribute become a garbage encoding when I send the image to the editor. The "title" attribute does not appear. Can you kindly fix it?
Attachments (1)
Change History (10)
#5
@
20 years ago
We typically never use htmlentities due to the encoding issues. Let's remove the htmlentities references entirely. Passing blog_charset as the encoding is not always sufficient.
#6
@
20 years ago
- Resolution set to fixed
- Status changed from new to closed
wp_specialchars is in where htmlentities was suggested. Tested inline-uploading functions extensively on a utf-8 blog. Ticket author leaves no mention of charset, so utf-8 was (hopefully) assumed.
#7
@
20 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
This looks good in 2.1 but let's get it fixed for 2.0.4.
Note: See
TracTickets for help on using
tickets.
I've found that it is caused by incorrect use of htmlentities, I've fixed it with the following patch:
diff -Naur wp-admin/inline-uploading.php.orig wp-admin/inline-uploading.php --- wp-admin/inline-uploading.php.orig 2006-06-11 03:26:01.000000000 +0600 +++ wp-admin/inline-uploading.php 2006-06-11 03:17:59.000000000 +0600 @@ -238,7 +238,7 @@ $xpadding = (128 - $image['uwidth']) / 2; $ypadding = (96 - $image['uheight']) / 2; $style .= "#target{$ID} img { padding: {$ypadding}px {$xpadding}px; }\n"; - $title = htmlentities($image['post_title'], ENT_QUOTES); + $title = htmlentities($image['post_title'], ENT_QUOTES, get_settings('blog_charset')); $script .= "aa[{$ID}] = '<a id=\"p{$ID}\" rel=\"attachment\" class=\"imagelink\" href=\"$href\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">'; ab[{$ID}] = '<a class=\"imagelink\" href=\"{$image['guid']}\" onclick=\"doPopup({$ID});return false;\" title=\"{$title}\">'; imga[{$ID}] = '<img id=\"image{$ID}\" src=\"$src\" alt=\"{$title}\" $height_width />'; @@ -258,7 +258,7 @@ </div> "; } else { - $title = htmlentities($attachment['post_title'], ENT_QUOTES); + $title = htmlentities($attachment['post_title'], ENT_QUOTES, get_settings('blog_charset')); $filename = basename($attachment['guid']); $icon = get_attachment_icon($ID); $toggle_icon = "<a id=\"I{$ID}\" onclick=\"toggleOtherIcon({$ID});return false;\" href=\"javascript:void()\">$__using_title</a>";Can developers have a look at this?