Changeset 50822 for trunk/src/wp-includes/functions.php
- Timestamp:
- 05/07/2021 09:31:01 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r50814 r50822 3045 3045 * 3046 3046 * @since 4.7.1 3047 * @since 5.8.0 Added support for WebP images. 3047 3048 * 3048 3049 * @param string $file Full path to the file. … … 3060 3061 $mime = ( $imagetype ) ? image_type_to_mime_type( $imagetype ) : false; 3061 3062 } elseif ( function_exists( 'getimagesize' ) ) { 3062 $imagesize = wp_getimagesize( $file ); 3063 $mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false; 3063 // Don't silence errors when in debug mode, unless running unit tests. 3064 if ( defined( 'WP_DEBUG' ) && WP_DEBUG 3065 && ! defined( 'WP_RUN_CORE_TESTS' ) 3066 ) { 3067 // Not using wp_getimagesize() here to avoid an infinite loop. 3068 $imagesize = getimagesize( $file ); 3069 } else { 3070 // phpcs:ignore WordPress.PHP.NoSilencedErrors 3071 $imagesize = @getimagesize( $file ); 3072 } 3073 3074 $mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false; 3064 3075 } else { 3065 3076 $mime = false;
Note: See TracChangeset
for help on using the changeset viewer.