diff --git a/includes/wc-core-functions.php b/includes/wc-core-functions.php index d0298871e68..ccc71dcfc6a 100644 --- a/includes/wc-core-functions.php +++ b/includes/wc-core-functions.php @@ -976,14 +976,14 @@ function wc_get_image_size( $image_size ) { $size['height'] = ''; $size['crop'] = 0; } elseif ( 'custom' === $cropping ) { - $width = max( 1, get_option( 'woocommerce_thumbnail_cropping_custom_width', '4' ) ); - $height = max( 1, get_option( 'woocommerce_thumbnail_cropping_custom_height', '3' ) ); + $width = max( 1, (float) get_option( 'woocommerce_thumbnail_cropping_custom_width', '4' ) ); + $height = max( 1, (float) get_option( 'woocommerce_thumbnail_cropping_custom_height', '3' ) ); $size['height'] = absint( NumberUtil::round( ( $size['width'] / $width ) * $height ) ); $size['crop'] = 1; } else { $cropping_split = explode( ':', $cropping ); - $width = max( 1, current( $cropping_split ) ); - $height = max( 1, end( $cropping_split ) ); + $width = max( 1, (float) current( $cropping_split ) ); + $height = max( 1, (float) end( $cropping_split ) ); $size['height'] = absint( NumberUtil::round( ( $size['width'] / $width ) * $height ) ); $size['crop'] = 1; }