From c8a1a2764c069dc41fa10d080a1058e717fce7d8 Mon Sep 17 00:00:00 2001 From: Vladimir Drok Date: Fri, 31 Jul 2020 17:17:10 +0300 Subject: [PATCH] Release (#201) release --- Block/Post/PostList.php | 14 +++++++++++--- CHANGELOG.md | 11 +++++++++++ composer.json | 4 ++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Block/Post/PostList.php b/Block/Post/PostList.php index 35021e4..879548b 100644 --- a/Block/Post/PostList.php +++ b/Block/Post/PostList.php @@ -2,6 +2,7 @@ namespace Mirasvit\Blog\Block\Post; +use Magento\Cms\Model\Template\FilterProvider; use Magento\Framework\DataObject\IdentityInterface; use Magento\Framework\Registry; use Magento\Framework\View\Element\Template\Context; @@ -30,13 +31,20 @@ class PostList extends AbstractBlock implements IdentityInterface */ private $postRepository; + /** + * @var FilterProvider + */ + private $filterProvider; + public function __construct( PostRepositoryInterface $postRepository, Config $config, + FilterProvider $filterProvider, Registry $registry, Context $context ) { $this->postRepository = $postRepository; + $this->filterProvider = $filterProvider; parent::__construct($config, $registry, $context); } @@ -100,16 +108,16 @@ public function getContentMoreTag($post) if ($this->config->getExcerptsEnabled()) { $size = $this->config->getExcerptSize(); if ($exerpt = strpos($post->getContent(), '')) { - return substr($post->getContent(), 0, $exerpt); + return $this->filterProvider->getPageFilter()->filter(substr($post->getContent(), 0, $exerpt)); } elseif ($post->getShortContent()) { - return $post->getShortContent(); + return $this->filterProvider->getPageFilter()->filter($post->getShortContent()); } elseif (preg_match('/^.{1,' . $size . '}\b/s', $this->stripTags( preg_replace("/]*>(.*?)<\\/style>/s", "", $post->getContent()) ), $match)) { return $match[0]; } - return $post->getContent(); + return $this->filterProvider->getPageFilter()->filter($post->getContent()); } return ''; diff --git a/CHANGELOG.md b/CHANGELOG.md index 042090d..ab39442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,15 @@ # Change Log +## 1.0.41 +*(2020-07-31)* + +#### Fixed +* Magento 2.4.0 compatibility +* Fixed issue with images in short content + + +--- + + ## 1.0.40 *(2020-06-16)* diff --git a/composer.json b/composer.json index 4dbfa3f..1dbd4d9 100644 --- a/composer.json +++ b/composer.json @@ -2,13 +2,13 @@ "name": "mirasvit/module-blog", "description": "Mirasvit Blog MX", "require": { - "magento/framework": "100.1.*|100.2.*|101.0.*|102.0.*" + "magento/framework": "100.1.*|100.2.*|101.0.*|102.0.*|103.0.*" }, "suggest": { "mirasvit/module-blog-sample-data": "Sample Data for Blog" }, "type": "magento2-module", - "version": "1.0.40", + "version": "1.0.41", "license": [ "OSL-3.0" ],