Ticket #49889: 49889.4.diff
File 49889.4.diff, 7.8 KB (added by , 5 years ago) |
---|
-
src/wp-admin/includes/ajax-actions.php
3927 3927 $parent_url = wp_get_attachment_url( $attachment_id ); 3928 3928 $url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url ); 3929 3929 3930 $size = @getimagesize( $cropped );3930 $size = wp_getimagesize( $cropped ); 3931 3931 $image_type = ( $size ) ? $size['mime'] : 'image/jpeg'; 3932 3932 3933 3933 $object = array( -
src/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( -
src/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( -
src/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 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { 723 $iptc = iptcparse( $info['APP13'] ); 724 } else { 725 $iptc = @iptcparse( $info['APP13'] ); 726 } 723 727 724 728 // Headline, "A brief synopsis of the caption". 725 729 if ( ! empty( $iptc['2#105'][0] ) ) { … … 779 783 $exif_image_types = apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ); 780 784 781 785 if ( is_callable( 'exif_read_data' ) && in_array( $image_type, $exif_image_types, true ) ) { 782 $exif = @exif_read_data( $file ); 786 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { 787 $exif = exif_read_data( $file ); 788 } else { 789 $exif = @exif_read_data( $file ); 790 } 783 791 784 792 if ( ! empty( $exif['ImageDescription'] ) ) { 785 793 mbstring_binary_safe_encoding(); … … 877 885 * @return bool True if valid image, false if not valid image. 878 886 */ 879 887 function file_is_valid_image( $path ) { 880 $size = @getimagesize( $path );888 $size = wp_getimagesize( $path ); 881 889 return ! empty( $size ); 882 890 } 883 891 … … 892 900 function file_is_displayable_image( $path ) { 893 901 $displayable_image_types = array( IMAGETYPE_GIF, IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_BMP, IMAGETYPE_ICO ); 894 902 895 $info = @getimagesize( $path );903 $info = wp_getimagesize( $path ); 896 904 if ( empty( $info ) ) { 897 905 $result = false; 898 906 } elseif ( ! in_array( $info[2], $displayable_image_types, true ) ) { -
src/wp-includes/class-wp-image-editor-gd.php
105 105 return new WP_Error( 'invalid_image', __( 'File is not an image.' ), $this->file ); 106 106 } 107 107 108 $size = @getimagesize( $this->file );108 $size = wp_getimagesize( $this->file ); 109 109 110 110 if ( ! $size ) { 111 111 return new WP_Error( 'invalid_image', __( 'Could not read image size.' ), $this->file ); -
src/wp-includes/deprecated.php
1947 1947 // Do we need to constrain the image? 1948 1948 if ( ($max_dims = apply_filters('attachment_max_dims', $max_dims)) && file_exists($src_file) ) { 1949 1949 1950 $imagesize = @getimagesize($src_file);1950 $imagesize = wp_getimagesize($src_file); 1951 1951 1952 1952 if (($imagesize[0] > $max_dims[0]) || $imagesize[1] > $max_dims[1] ) { 1953 1953 $actual_aspect = $imagesize[0] / $imagesize[1]; -
src/wp-includes/functions.php
3044 3044 $imagetype = exif_imagetype( $file ); 3045 3045 $mime = ( $imagetype ) ? image_type_to_mime_type( $imagetype ) : false; 3046 3046 } elseif ( function_exists( 'getimagesize' ) ) { 3047 $imagesize = @getimagesize( $file );3047 $imagesize = wp_getimagesize( $file ); 3048 3048 $mime = ( isset( $imagesize['mime'] ) ) ? $imagesize['mime'] : false; 3049 3049 } else { 3050 3050 $mime = false; … … 7767 7767 function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) { 7768 7768 return abs( (float) $expected - (float) $actual ) <= $precision; 7769 7769 } 7770 7771 /** 7772 * Allows PHP's getimagesize() to be debuggable when necessary. 7773 * 7774 * @since 5.6.0 7775 * 7776 * @param string $filename The file path. 7777 * @param array $imageinfo Extended image information, passed by reference. 7778 * @return array|false Array of image information or false on failure. 7779 */ 7780 function wp_getimagesize( $filename, &$imageinfo = array() ) { 7781 if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { 7782 return getimagesize( $filename, $imageinfo ); 7783 } 7784 7785 return @getimagesize( $filename, $imageinfo ); 7786 } -
src/wp-includes/media.php
244 244 $info = null; 245 245 246 246 if ( $thumb_file ) { 247 $info = @getimagesize( $thumb_file );247 $info = wp_getimagesize( $thumb_file ); 248 248 } 249 249 250 250 if ( $thumb_file && $info ) { … … 962 962 $icon_dir = apply_filters( 'icon_dir', ABSPATH . WPINC . '/images/media' ); 963 963 964 964 $src_file = $icon_dir . '/' . wp_basename( $src ); 965 list( $width, $height ) = @getimagesize( $src_file );965 list( $width, $height ) = wp_getimagesize( $src_file ); 966 966 } 967 967 } 968 968