From 977ec729e1e2a124b8600d7e9abda8f59419b05b Mon Sep 17 00:00:00 2001 From: Jerome Barbato Date: Thu, 17 Oct 2024 17:08:08 +0200 Subject: [PATCH] bugfix --- composer.json | 2 +- src/Entity/Image.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index a48c321..e529cad 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name":"metabolism/wordpress-bundle", "type": "symfony-bundle", - "version": "2.3.5", + "version": "2.3.6", "description": "Build enterprise solutions with WordPress", "license": "MIT", "keywords": [ diff --git a/src/Entity/Image.php b/src/Entity/Image.php index 4c979df..2a97560 100644 --- a/src/Entity/Image.php +++ b/src/Entity/Image.php @@ -267,8 +267,8 @@ protected function get($id) $this->title = $post->post_title; $this->alt = trim(strip_tags($post_meta['_wp_attachment_image_alt'][0]??'')); - $this->width = $attachment_metadata['width']; - $this->height = $attachment_metadata['height']; + $this->width = intval($attachment_metadata['width']); + $this->height = intval($attachment_metadata['height']); $this->ratio = $this->width/$this->height; $this->metadata = $attachment_metadata['image_meta']; $this->mime_type = $post->post_mime_type;