Permalink
Browse files

utf8 encode data from IPTC tags. Fixes #7495 for 2.6 branch props Txa…

…nny.

git-svn-id: http://svn.automattic.com/wordpress/branches/2.6@8745 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
1 parent cc67b7a commit 641e1e9fb31030e1e58fb291808f4ec8a5a86455 westi committed Aug 27, 2008
Showing with 5 additions and 5 deletions.
  1. +5 −5 wp-admin/includes/image.php
@@ -219,17 +219,17 @@ function wp_read_image_metadata( $file ) {
if ( !empty($info['APP13']) ) {
$iptc = iptcparse($info['APP13']);
if ( !empty($iptc['2#110'][0]) ) // credit
- $meta['credit'] = trim( $iptc['2#110'][0] );
+ $meta['credit'] = utf8_encode(trim($iptc['2#110'][0]));
elseif ( !empty($iptc['2#080'][0]) ) // byline
- $meta['credit'] = trim( $iptc['2#080'][0] );
+ $meta['credit'] = utf8_encode(trim($iptc['2#080'][0]));
if ( !empty($iptc['2#055'][0]) and !empty($iptc['2#060'][0]) ) // created datee and time
$meta['created_timestamp'] = strtotime($iptc['2#055'][0] . ' ' . $iptc['2#060'][0]);
if ( !empty($iptc['2#120'][0]) ) // caption
- $meta['caption'] = trim( $iptc['2#120'][0] );
+ $meta['caption'] = utf8_encode(trim($iptc['2#120'][0]));
if ( !empty($iptc['2#116'][0]) ) // copyright
- $meta['copyright'] = trim( $iptc['2#116'][0] );
+ $meta['copyright'] = utf8_encode(trim($iptc['2#116'][0]));
if ( !empty($iptc['2#005'][0]) ) // title
- $meta['title'] = trim( $iptc['2#005'][0] );
+ $meta['title'] = utf8_encode(trim($iptc['2#005'][0]));
}
}

0 comments on commit 641e1e9

Please sign in to comment.