WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/01/2016 02:57:53 PM (6 years ago)
Author:
ocean90
Message:

Media: In wp_read_image_metadata() make sure that IPTC keywords are UTF8 encoded.

Prevents missing _wp_attachment_metadata when an image contains keywords with latin extended characters.

Merges [36429] to the 4.4 branch.
See #35316.

Location:
branches/4.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.4

  • branches/4.4/src/wp-admin/includes/image.php

    r35554 r36430  
    409409    }
    410410
    411     foreach ( $meta as &$value ) {
    412         if ( is_string( $value ) ) {
    413             $value = wp_kses_post( $value );
    414         }
    415     }
     411    foreach ( $meta['keywords'] as $key => $keyword ) {
     412        if ( ! seems_utf8( $keyword ) ) {
     413            $meta['keywords'][ $key ] = utf8_encode( $keyword );
     414        }
     415    }
     416
     417    $meta = wp_kses_post_deep( $meta );
    416418
    417419    /**
Note: See TracChangeset for help on using the changeset viewer.