Ticket #49889: 49889-3.diff
File 49889-3.diff, 7.7 KB (added by , 5 years ago) |
---|
-
wp-admin/includes/ajax-actions.php
3900 3900 $parent_url = wp_get_attachment_url( $attachment_id ); 3901 3901 $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url ); 3902 3902 3903 $size = @getimagesize( $cropped );3903 $size = wp_getimagesize( $cropped ); 3904 3904 $image_type = ( $size ) ? $size['mime'] : 'image/jpeg'; 3905 3905 3906 3906 $object = array( -
wp-admin/includes/class-custom-image-header.php
791 791 } 792 792 793 793 if ( file_exists( $file ) ) { 794 list( $width, $height, $type, $attr ) = @getimagesize( $file );794 list( $width, $height, $type, $attr ) = wp_getimagesize( $file ); 795 795 } else { 796 796 $data = wp_get_attachment_metadata( $attachment_id ); 797 797 $height = isset( $data['height'] ) ? $data['height'] : 0; … … 1223 1223 $parent_url = wp_get_attachment_url( $parent->ID ); 1224 1224 $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url ); 1225 1225 1226 $size = @getimagesize( $cropped );1226 $size = wp_getimagesize( $cropped ); 1227 1227 $image_type = ( $size ) ? $size['mime'] : 'image/jpeg'; 1228 1228 1229 1229 $object = array( -
wp-admin/includes/class-wp-site-icon.php
87 87 $parent_url = wp_get_attachment_url( $parent->ID ); 88 88 $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url ); 89 89 90 $size = @getimagesize( $cropped );90 $size = wp_getimagesize( $cropped ); 91 91 $image_type = ( $size ) ? $size['mime'] : 'image/jpeg'; 92 92 93 93 $object = array( -
wp-admin/includes/image.php
93 93 // Use the originally uploaded image dimensions as full_width and full_height. 94 94 if ( ! empty( $image_meta['original_image'] ) ) { 95 95 $image_file = wp_get_original_image_path( $attachment_id ); 96 $imagesize = @getimagesize( $image_file );96 $imagesize = wp_getimagesize( $image_file ); 97 97 } 98 98 99 99 if ( ! empty( $imagesize ) ) { … … 224 224 * @return array The image attachment meta data. 225 225 */ 226 226 function wp_create_image_subsizes( $file, $attachment_id ) { 227 $imagesize = @getimagesize( $file );227 $imagesize = wp_getimagesize( $file ); 228 228 229 229 if ( empty( $imagesize ) ) { 230 230 // File is not an image. … … 687 687 return false; 688 688 } 689 689 690 list( , , $image_type ) = @getimagesize( $file );690 list( , , $image_type ) = wp_getimagesize( $file ); 691 691 692 692 /* 693 693 * EXIF contains a bunch of data we'll probably never need formatted in ways … … 716 716 * as caption, description etc. 717 717 */ 718 718 if ( is_callable( 'iptcparse' ) ) { 719 @getimagesize( $file, $info );719 wp_getimagesize( $file, $info ); 720 720 721 721 if ( ! empty( $info['APP13'] ) ) { 722 $iptc = @iptcparse( $info['APP13'] ); 722 723 if( defined( 'WP_DEBUG' ) && WP_DEBUG ) { 724 $iptc = iptcparse( $info['APP13'] ); 725 } else { 726 $iptc = @iptcparse( $info['APP13'] ); 727 } 723 728 724 729 // Headline, "A brief synopsis of the caption". 725 730 if ( ! empty( $iptc['2#105'][0] ) ) { … … 779 784 $exif_image_types = apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ); 780 785 781 786 if ( is_callable( 'exif_read_data' ) && in_array( $image_type, $exif_image_types, true ) ) { 782 $exif = @exif_read_data( $file ); 787 788 if( defined( 'WP_DEBUG' ) && WP_DEBUG ) { 789 $exif = exif_read_data( $file ); 790 } else { 791 $exif = @exif_read_data( $file ); 792 } 783 793 784 794 if ( ! empty( $exif['ImageDescription'] ) ) { 785 795 mbstring_binary_safe_encoding(); … … 877 887 * @return bool True if valid image, false if not valid image. 878 888 */ 879 889 function file_is_valid_image( $path ) { 880 $size = @getimagesize( $path );890 $size = wp_getimagesize( $path ); 881 891 return ! empty( $size ); 882 892 } 883 893 … … 892 902 function file_is_displayable_image( $path ) { 893 903 $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_ICO ); 894 904 895 $info = @getimagesize( $path );905 $info = wp_getimagesize( $path ); 896 906 if ( empty( $info ) ) { 897 907 $result = false; 898 908 } elseif ( ! in_array( $info[2], $displayable_image_types, true ) ) { -
wp-includes/class-wp-image-editor-gd.php
99 99 return new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file ); 100 100 } 101 101 102 $size = @getimagesize( $this->file );102 $size = wp_getimagesize( $this->file ); 103 103 if ( ! $size ) { 104 104 return new WP_Error( 'invalid_image', __( 'Could not read image size.' ), $this->file ); 105 105 } -
wp-includes/deprecated.php
1924 1924 // Do we need to constrain the image? 1925 1925 if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) { 1926 1926 1927 $imagesize = @getimagesize($src_file);1927 $imagesize = wp_getimagesize($src_file); 1928 1928 1929 1929 if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) { 1930 1930 $actual_aspect = $imagesize[0] / $imagesize[1]; -
wp-includes/functions.php
2992 2992 $imagetype = exif_imagetype( $file ); 2993 2993 $mime = ( $imagetype ) ? image_type_to_mime_type( $imagetype ) : false; 2994 2994 } elseif ( function_exists( 'getimagesize' ) ) { 2995 $imagesize = @getimagesize( $file );2995 $imagesize = wp_getimagesize( $file ); 2996 2996 $mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false; 2997 2997 } else { 2998 2998 $mime = false; … … 7606 7606 function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) { 7607 7607 return abs( (float) $expected - (float) $actual ) <= $precision; 7608 7608 } 7609 7610 /** 7611 * Allow PHPs getimagesize() to be debuggable when necessary. 7612 * 7613 * @since 5.5.0 7614 * 7615 * @param string $filename The file path. 7616 * @param array $imageinfo Extended image information. 7617 * @return array|false Array of image information or false on failure. 7618 */ 7619 function wp_getimagesize( $filename, &$imageinfo = array() ) { 7620 7621 if( defined( 'WP_DEBUG' ) && WP_DEBUG ) { 7622 return getimagesize( $filename, $imageinfo ); 7623 } 7624 7625 return @getimagesize( $filename, $imageinfo ); 7626 7627 } -
wp-includes/media.php
245 245 $info = null; 246 246 247 247 if ( $thumb_file ) { 248 $info = @getimagesize( $thumb_file );248 $info = wp_getimagesize( $thumb_file ); 249 249 } 250 250 251 251 if ( $thumb_file && $info ) { … … 963 963 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); 964 964 965 965 $src_file = $icon_dir . '/' . wp_basename( $src ); 966 list( $width, $height ) = @getimagesize( $src_file );966 list( $width, $height ) = wp_getimagesize( $src_file ); 967 967 } 968 968 } 969 969