mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-12 21:00:21 +00:00
Introduce a binary-safe wrapper for strlen() and use it in seems_utf8(), utf8_uri_encode(), and wp_read_image_metadata().
Use binary-safe POMO_Reader::strlen() in MO::export_to_file_handle(). fixes #28162. git-svn-id: https://develop.svn.wordpress.org/trunk@28806 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -290,7 +290,7 @@ function wp_read_image_metadata( $file ) {
|
||||
$caption = trim( $iptc['2#120'][0] );
|
||||
if ( empty( $meta['title'] ) ) {
|
||||
// Assume the title is stored in 2:120 if it's short.
|
||||
if ( strlen( $caption ) < 80 )
|
||||
if ( mbstring_binary_safe_strlen( $caption ) < 80 )
|
||||
$meta['title'] = $caption;
|
||||
else
|
||||
$meta['caption'] = $caption;
|
||||
@@ -327,7 +327,7 @@ function wp_read_image_metadata( $file ) {
|
||||
}
|
||||
|
||||
if ( ! empty( $exif['ImageDescription'] ) ) {
|
||||
if ( empty( $meta['title'] ) && strlen( $exif['ImageDescription'] ) < 80 ) {
|
||||
if ( empty( $meta['title'] ) && mbstring_binary_safe_strlen( $exif['ImageDescription'] ) < 80 ) {
|
||||
// Assume the title is stored in ImageDescription
|
||||
$meta['title'] = trim( $exif['ImageDescription'] );
|
||||
if ( empty( $meta['caption'] ) && ! empty( $exif['COMPUTED']['UserComment'] ) && trim( $exif['COMPUTED']['UserComment'] ) != $meta['title'] ) {
|
||||
|
||||
Reference in New Issue
Block a user