diff --git src/wp-admin/includes/image.php src/wp-admin/includes/image.php
index 4b66a5d36f..0a2be45278 100644
|
|
function wp_read_image_metadata( $file ) { |
357 | 357 | return false; |
358 | 358 | } |
359 | 359 | |
360 | | list( , , $sourceImageType ) = getimagesize( $file ); |
| 360 | list( , , $sourceImageType ) = @getimagesize( $file ); |
361 | 361 | |
362 | 362 | /* |
363 | 363 | * EXIF contains a bunch of data we'll probably never need formatted in ways |
… |
… |
function wp_read_image_metadata( $file ) { |
389 | 389 | getimagesize( $file, $info ); |
390 | 390 | |
391 | 391 | if ( ! empty( $info['APP13'] ) ) { |
392 | | $iptc = iptcparse( $info['APP13'] ); |
| 392 | $iptc = @iptcparse( $info['APP13'] ); |
393 | 393 | |
394 | 394 | // Headline, "A brief synopsis of the caption." |
395 | 395 | if ( ! empty( $iptc['2#105'][0] ) ) { |
diff --git src/wp-admin/includes/media.php src/wp-admin/includes/media.php
index 03e949f16f..42584ee5c0 100644
|
|
function media_handle_upload( $file_id, $post_id, $post_data = array(), $overrid |
368 | 368 | $content .= ' ' . sprintf( __( 'Genre: %s.' ), $meta['genre'] ); |
369 | 369 | } |
370 | 370 | |
371 | | // Use image exif/iptc data for title and caption defaults if possible. |
372 | | } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = @wp_read_image_metadata( $file ) ) { |
| 371 | // Use image exif/iptc data for title and caption defaults if possible. |
| 372 | } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = wp_read_image_metadata( $file ) ) { |
373 | 373 | if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) { |
374 | 374 | $title = $image_meta['title']; |
375 | 375 | } |
… |
… |
function media_handle_sideload( $file_array, $post_id, $desc = null, $post_data |
437 | 437 | $content = ''; |
438 | 438 | |
439 | 439 | // Use image exif/iptc data for title and caption defaults if possible. |
440 | | if ( $image_meta = @wp_read_image_metadata( $file ) ) { |
| 440 | if ( $image_meta = wp_read_image_metadata( $file ) ) { |
441 | 441 | if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) { |
442 | 442 | $title = $image_meta['title']; |
443 | 443 | } |
diff --git src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
index 528a6ce0c6..30ddafc982 100644
|
|
class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { |
123 | 123 | $file = $file['file']; |
124 | 124 | |
125 | 125 | // use image exif/iptc data for title and caption defaults if possible |
126 | | $image_meta = @wp_read_image_metadata( $file ); |
| 126 | $image_meta = wp_read_image_metadata( $file ); |
127 | 127 | |
128 | 128 | if ( ! empty( $image_meta ) ) { |
129 | 129 | if ( empty( $request['title'] ) && trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) { |