Skip to content

Commit 2cf6862

Browse files
authored
release: small fixes
* Resolved a critical issue that caused a fatal error when the width or height parameters were left empty in certain edge cases.
2 parents b63d8df + 179fa55 commit 2cf6862

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

inc/app_replacer.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,8 @@ public function url_has_dam_flag( $url ) {
643643
* @return string
644644
*/
645645
protected function get_optimized_image_url( $url, $width, $height, $resize = [] ) {
646+
$width = is_int( $width ) ? $width : 'auto';
647+
$height = is_int( $height ) ? $height : 'auto';
646648
$optimized_image = Optimole::image( $url, $this->settings->get( 'cache_buster' ) )
647649
->width( $width )
648650
->height( $height );

inc/url_replacer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,8 @@ private function normalize_image( $url, $original_url, $args, $is_uploaded = fal
230230
$args = apply_filters( 'optml_image_args', $args, $original_url );
231231
$image = Optimole::image( apply_filters( 'optml_processed_url', $url ), $this->active_cache_buster );
232232

233-
$image->width( ! empty( $args['width'] ) ? $args['width'] : 'auto' );
234-
$image->height( ! empty( $args['height'] ) ? $args['height'] : 'auto' );
233+
$image->width( ! empty( $args['width'] ) && is_int( $args['width'] ) ? $args['width'] : 'auto' );
234+
$image->height( ! empty( $args['height'] ) && is_int( $args['height'] ) ? $args['height'] : 'auto' );
235235

236236
$image->quality( $args['quality'] );
237237

0 commit comments

Comments
 (0)