From 26fb7c968270001553e84bb71e697114c2a92f11 Mon Sep 17 00:00:00 2001 From: Anthony Burchell Date: Tue, 2 Feb 2021 21:34:40 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@50170 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/image.php | 4 ++-- src/wp-includes/media.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index e64c49c4d1..56b9c0a36f 100644 --- a/src/wp-admin/includes/image.php +++ b/src/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/src/wp-includes/media.php b/src/wp-includes/media.php index b22e04f3e3..11b6fae7d1 100644 --- a/src/wp-includes/media.php +++ b/src/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