[wp-trac] [WordPress Trac] #12095: Images insert at full size if metadata contains odd characters

WordPress Trac wp-trac at lists.automattic.com
Sun Jan 31 09:31:49 UTC 2010


#12095: Images insert at full size if metadata contains odd characters
--------------------------+-------------------------------------------------
 Reporter:  whlitwa       |       Owner:            
     Type:  defect (bug)  |      Status:  new       
 Priority:  high          |   Milestone:  Unassigned
Component:  Upload        |     Version:  2.9.1     
 Severity:  normal        |    Keywords:            
--------------------------+-------------------------------------------------
 If the metadata of an image contains odd characters (e.g. © copyright
 symbol), the image will almost invariably insert into your post as full
 size.
 For some reason, this doesn't ''always'' occur.  I'm not sure why.

 I've tracked this bug to an older version and found that this problem was
 once fixed.
 http://core.trac.wordpress.org/ticket/7495

 ----

 /wp-admin/includes/image.php: lines 276, 278, 282, 284, 286:

 {{{
 $meta['credit'] = trim($iptc['2#110'][0]);
 }}}
 was changed in 2.6.2 to:
 {{{
 $meta['credit'] = utf8_encode(trim($iptc['2#110'][0]));
 }}}

 And so the problem seemed to disappear.  Unfortunetly, the problem seems
 to have come back.  I've applied this fix:
 {{{
 $meta['credit'] = htmlentities(utf8_encode(trim($iptc['2#110'][0])));
 }}}
 It ''seems'' to correct the bug.  Sadly, the copyright symbol no longer
 appears correctly.  I'm certain there's a better way to fix this.

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


More information about the wp-trac mailing list