Changeset 37034 for trunk/src/wp-includes/media.php
- Timestamp:
- 03/18/2016 07:44:50 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r37022 r37034 1068 1068 */ 1069 1069 foreach ( $image_sizes as $image ) { 1070 $is_src = false; 1070 1071 1071 1072 // Check if image meta isn't corrupted. … … 1076 1077 // If the file name is part of the `src`, we've confirmed a match. 1077 1078 if ( ! $src_matched && false !== strpos( $image_src, $dirname . $image['file'] ) ) { 1078 $src_matched = true;1079 $src_matched = $is_src = true; 1079 1080 } 1080 1081 … … 1088 1089 * that file is in the 'src' attribute. 1089 1090 */ 1090 if ( $max_srcset_image_width && $image['width'] > $max_srcset_image_width && 1091 false === strpos( $image_src, $image['file'] ) ) { 1092 1091 if ( $max_srcset_image_width && $image['width'] > $max_srcset_image_width && ! $is_src ) { 1093 1092 continue; 1094 1093 } … … 1110 1109 if ( abs( $constrained_size[0] - $expected_size[0] ) <= 1 && abs( $constrained_size[1] - $expected_size[1] ) <= 1 ) { 1111 1110 // Add the URL, descriptor, and value to the sources array to be returned. 1112 $source s[ $image['width'] ]= array(1111 $source = array( 1113 1112 'url' => $image_baseurl . $image['file'], 1114 1113 'descriptor' => 'w', 1115 1114 'value' => $image['width'], 1116 1115 ); 1116 1117 // The 'src' image has to be the first in the 'srcset', because of a bug in iOS8. See #35030. 1118 if ( $is_src ) { 1119 $sources = array( $image['width'] => $source ) + $sources; 1120 } else { 1121 $sources[ $image['width'] ] = $source; 1122 } 1117 1123 } 1118 1124 }
Note: See TracChangeset
for help on using the changeset viewer.