diff --git a/wp-includes/functions.php b/wp-includes/functions.php index a8c4747c39..5935f781fb 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -7866,36 +7866,3 @@ function is_php_version_compatible( $required ) { function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) { return abs( (float) $expected - (float) $actual ) <= $precision; } - -/** - * Allows PHP's getimagesize() to be debuggable when necessary. - * - * @since 5.7.0 - * - * @param string $filename The file path. - * @param array $imageinfo Extended image information, passed by reference. - * @return array|false Array of image information or false on failure. - */ -function wp_getimagesize( $filename, &$imageinfo = array() ) { - if ( - // Skip when running unit tests. - ! defined( 'DIR_TESTDATA' ) - && - // Return without silencing errors when in debug mode. - defined( 'WP_DEBUG' ) && WP_DEBUG - ) { - return getimagesize( $filename, $imageinfo ); - } - - /** - * Silencing notice and warning is intentional. - * - * getimagesize() has a tendency to generate errors, such as "corrupt JPEG data: 7191 extraneous bytes before - * marker", even when it's able to provide image size information. - * - * See https://core.trac.wordpress.org/ticket/42480 - * - * phpcs:ignore WordPress.PHP.NoSilencedErrors - */ - return @getimagesize( $filename, $imageinfo ); -} diff --git a/wp-includes/media.php b/wp-includes/media.php index cf3a9d9f31..093e7bc4ff 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1628,7 +1628,7 @@ function wp_image_src_get_dimensions( $image_src, $image_meta, $attachment_id = } /** - * Filter the 'wp_image_src_get_dimensions' value. + * Filters the 'wp_image_src_get_dimensions' value. * * @since 5.7.0 * @@ -4962,3 +4962,37 @@ function wp_show_heic_upload_error( $plupload_settings ) { $plupload_settings['heic_upload_error'] = true; return $plupload_settings; } + +/** + * Allows PHP's getimagesize() to be debuggable when necessary. + * + * @since 5.7.0 + * + * @param string $filename The file path. + * @param array $imageinfo Extended image information, passed by reference. + * @return array|false Array of image information or false on failure. + */ +function wp_getimagesize( $filename, &$imageinfo = array() ) { + if ( + // Skip when running unit tests. + ! defined( 'DIR_TESTDATA' ) + && + // Return without silencing errors when in debug mode. + defined( 'WP_DEBUG' ) && WP_DEBUG + ) { + return getimagesize( $filename, $imageinfo ); + } + + /* + * Silencing notice and warning is intentional. + * + * getimagesize() has a tendency to generate errors, such as + * "corrupt JPEG data: 7191 extraneous bytes before marker", + * even when it's able to provide image size information. + * + * See https://core.trac.wordpress.org/ticket/42480 + * + * phpcs:ignore WordPress.PHP.NoSilencedErrors + */ + return @getimagesize( $filename, $imageinfo ); +} diff --git a/wp-includes/version.php b/wp-includes/version.php index d840a9b036..16b2bd8991 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-alpha-50147'; +$wp_version = '5.7-alpha-50148'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.