[wp-trac] Re: [WordPress Trac] #2393: Encoding problem while uploader is used

WordPress Trac wp-trac at lists.automattic.com
Sat Jun 10 21:32:02 GMT 2006


#2393: Encoding problem while uploader is used
-----------------------+----------------------------------------------------
       Id:  2393       |      Status:  new                     
Component:  General    |    Modified:  Sat Jun 10 21:32:02 2006
 Severity:  normal     |   Milestone:                          
 Priority:  normal     |     Version:  2.0.2                   
    Owner:  anonymous  |    Reporter:  JamshidZartoshti        
-----------------------+----------------------------------------------------
Changes (by ilya):

  * version:  1.2 => 2.0.2

Comment:

 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?

-- 
Ticket URL: <http://trac.wordpress.org/ticket/2393>
WordPress Trac <http://wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list