From b566631d5ea5960664a24b47440fa8d29108b09a Mon Sep 17 00:00:00 2001 From: antpb Date: Tue, 2 Feb 2021 21:36:03 +0000 Subject: [PATCH] Media: Consistency in logic to pass `wp_getimagesize()` tests. Previously, we used `DIR_TESTDATA` to determine if a test should skip a newly silenced error in `wp_getimagesize()`. We are now using `WP_RUN_CORE_TESTS` instead for consistency. Props hellofromTonya, SergeyBiryukov. See #49889. Built from https://develop.svn.wordpress.org/trunk@50170 git-svn-id: http://core.svn.wordpress.org/trunk@49849 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/image.php | 4 ++-- wp-includes/media.php | 2 +- wp-includes/version.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index e64c49c4d1..56b9c0a36f 100644 --- a/wp-admin/includes/image.php +++ b/wp-admin/includes/image.php @@ -721,7 +721,7 @@ function wp_read_image_metadata( $file ) { if ( ! empty( $info['APP13'] ) ) { if ( // Skip when running unit tests. - ! defined( 'DIR_TESTDATA' ) + ! defined( 'WP_RUN_CORE_TESTS' ) && // Process without silencing errors when in debug mode. defined( 'WP_DEBUG' ) && WP_DEBUG @@ -792,7 +792,7 @@ function wp_read_image_metadata( $file ) { if ( is_callable( 'exif_read_data' ) && in_array( $image_type, $exif_image_types, true ) ) { if ( // Skip when running unit tests. - ! defined( 'DIR_TESTDATA' ) + ! defined( 'WP_RUN_CORE_TESTS' ) && // Process without silencing errors when in debug mode. defined( 'WP_DEBUG' ) && WP_DEBUG diff --git a/wp-includes/media.php b/wp-includes/media.php index b22e04f3e3..11b6fae7d1 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -4975,7 +4975,7 @@ function wp_show_heic_upload_error( $plupload_settings ) { function wp_getimagesize( $filename, &$imageinfo = array() ) { if ( // Skip when running unit tests. - ! defined( 'DIR_TESTDATA' ) + ! defined( 'WP_RUN_CORE_TESTS' ) && // Return without silencing errors when in debug mode. defined( 'WP_DEBUG' ) && WP_DEBUG diff --git a/wp-includes/version.php b/wp-includes/version.php index a98ddbdbc2..5cfd0dfdb5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-alpha-50169'; +$wp_version = '5.7-alpha-50170'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.