diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php
index 8282499..6c91665 100644
a
|
b
|
function wp_read_image_metadata( $file ) { |
343 | 343 | if ( ! file_exists( $file ) ) |
344 | 344 | return false; |
345 | 345 | |
346 | | list( , , $sourceImageType ) = getimagesize( $file ); |
| 346 | list( , , $sourceImageType ) = @getimagesize( $file ); |
347 | 347 | |
348 | 348 | /* |
349 | 349 | * EXIF contains a bunch of data we'll probably never need formatted in ways |
… |
… |
function wp_read_image_metadata( $file ) { |
375 | 375 | getimagesize( $file, $info ); |
376 | 376 | |
377 | 377 | if ( ! empty( $info['APP13'] ) ) { |
378 | | $iptc = iptcparse( $info['APP13'] ); |
| 378 | $iptc = @iptcparse( $info['APP13'] ); |
379 | 379 | |
380 | 380 | // Headline, "A brief synopsis of the caption." |
381 | 381 | if ( ! empty( $iptc['2#105'][0] ) ) { |
diff --git a/src/wp-admin/includes/media.php b/src/wp-admin/includes/media.php
index 2ee607d..499ede3 100644
a
|
b
|
function media_handle_upload($file_id, $post_id, $post_data = array(), $override |
355 | 355 | } |
356 | 356 | |
357 | 357 | // Use image exif/iptc data for title and caption defaults if possible. |
358 | | } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = @wp_read_image_metadata( $file ) ) { |
| 358 | } elseif ( 0 === strpos( $type, 'image/' ) && $image_meta = wp_read_image_metadata( $file ) ) { |
359 | 359 | if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) { |
360 | 360 | $title = $image_meta['title']; |
361 | 361 | } |
… |
… |
function media_handle_sideload( $file_array, $post_id, $desc = null, $post_data |
419 | 419 | $content = ''; |
420 | 420 | |
421 | 421 | // Use image exif/iptc data for title and caption defaults if possible. |
422 | | if ( $image_meta = @wp_read_image_metadata($file) ) { |
| 422 | if ( $image_meta = wp_read_image_metadata($file) ) { |
423 | 423 | if ( trim( $image_meta['title'] ) && ! is_numeric( sanitize_title( $image_meta['title'] ) ) ) |
424 | 424 | $title = $image_meta['title']; |
425 | 425 | if ( trim( $image_meta['caption'] ) ) |
diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
index ed10181..cba3d56 100644
a
|
b
|
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'] ) ) ) { |