Images insert at full size if metadata contains odd characters
|Reported by:||whlitwa||Owned by:|
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.
/wp-admin/includes/image.php: lines 276, 278, 282, 284, 286:
$meta['credit'] = trim($iptc['2#110']);
was changed in 2.6.2 to:
$meta['credit'] = utf8_encode(trim($iptc['2#110']));
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'])));
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.
Change History (11)
comment:2 miqrogroove — 4 years ago
- Component changed from Upload to Media
- Keywords needs-testing added
- Milestone changed from Unassigned to 3.0