From 0c2bbd44415564ecdae10a33c5f292689f95b1c5 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 25 Mar 2018 20:40:03 +0000 Subject: [PATCH] Media: In `wp_read_image_metadata()`, rename `$sourceImageType` variable to `$image_type` to match coding standards. See #43624. git-svn-id: https://develop.svn.wordpress.org/trunk@42878 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/image.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index d6e6fbd563..56dd5510dd 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -357,7 +357,7 @@ function wp_read_image_metadata( $file ) { return false; } - list( , , $sourceImageType ) = @getimagesize( $file ); + list( , , $image_type ) = @getimagesize( $file ); /* * EXIF contains a bunch of data we'll probably never need formatted in ways @@ -444,7 +444,9 @@ function wp_read_image_metadata( $file ) { * * @param array $image_types Image types to check for exif data. */ - if ( is_callable( 'exif_read_data' ) && in_array( $sourceImageType, apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ) ) ) { + $exif_image_types = apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ); + + if ( is_callable( 'exif_read_data' ) && in_array( $image_type, $exif_image_types ) ) { $exif = @exif_read_data( $file ); if ( ! empty( $exif['ImageDescription'] ) ) { @@ -523,12 +525,12 @@ function wp_read_image_metadata( $file ) { * @since 2.5.0 * @since 4.4.0 The `$iptc` parameter was added. * - * @param array $meta Image meta data. - * @param string $file Path to image file. - * @param int $sourceImageType Type of image. - * @param array $iptc IPTC data. + * @param array $meta Image meta data. + * @param string $file Path to image file. + * @param int $image_type Type of image, one of the `IMAGETYPE_XXX` constants. + * @param array $iptc IPTC data. */ - return apply_filters( 'wp_read_image_metadata', $meta, $file, $sourceImageType, $iptc ); + return apply_filters( 'wp_read_image_metadata', $meta, $file, $image_type, $iptc ); }