Skip to content

Commit fd9cead

Browse files
committed
fix cache key on normalizer
1 parent fffa652 commit fd9cead

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

inc/traits/normalizer.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function size_to_dimension( $size, $image_meta ) {
212212
if ( ! $width || ! $height ) {
213213
break;
214214
}
215-
$cache_key = 'a' . $width . '_' . $height;
215+
$cache_key = 'a' . $width . '_' . $height . '_' . $sizes['width'] . '_' . $sizes['height'];
216216
if ( isset( self::$dimension_cache[ $cache_key ] ) ) {
217217
return self::$dimension_cache[ $cache_key ];
218218
}
@@ -225,10 +225,11 @@ public function size_to_dimension( $size, $image_meta ) {
225225
$height = $image_meta['height'];
226226
}
227227
list( $sizes['width'], $sizes['height'] ) = image_constrain_size_for_editor( $width, $height, $size );
228+
228229
self::$dimension_cache[ $cache_key ] = $sizes;
229230
break;
230231
case 'full' !== $size && isset( $image_args[ $size ] ):
231-
$cache_key = 'b' . $size;
232+
$cache_key = 'b' . $size . '_' . $sizes['width'] . '_' . $sizes['height'];
232233
if ( isset( self::$dimension_cache[ $cache_key ] ) ) {
233234
return self::$dimension_cache[ $cache_key ];
234235
}

0 commit comments

Comments
 (0)