Make WordPress Core

Ticket #58082: 58082.diff

File 58082.diff, 793 bytes (added by mikinc860, 13 months ago)

Uploaded the diff based on provided code.

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

    diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php
    index f937bdc2ff..73ce38d1c7 100644
    a b function wp_read_image_metadata( $file ) { 
    874874                        }
    875875                } elseif ( empty( $meta['caption'] ) && ! empty( $exif['Comments'] ) ) {
    876876                        $meta['caption'] = trim( $exif['Comments'] );
     877                } elseif ( empty( $meta['caption'] ) && ! empty( $exif['COMPUTED']['UserComment'] ) ) {
     878                        $meta['caption'] = trim( $exif['COMPUTED']['UserComment'] );
     879                        $description_length = strlen( $exif['COMPUTED']['UserComment'] );
     880                        if ( empty( $meta['title'] ) && $description_length < 80 ) {
     881                                        $meta['title'] = trim( $exif['COMPUTED']['UserComment'] );
     882                        }
    877883                }
    878884
    879885                if ( empty( $meta['credit'] ) ) {