Skip to content

Commit

Permalink
Release (mirasvit#201)
Browse files Browse the repository at this point in the history
release
  • Loading branch information
volodymyr-d authored Jul 31, 2020
1 parent afc6c07 commit c8a1a27
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
14 changes: 11 additions & 3 deletions Block/Post/PostList.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -100,16 +108,16 @@ public function getContentMoreTag($post)
if ($this->config->getExcerptsEnabled()) {
$size = $this->config->getExcerptSize();
if ($exerpt = strpos($post->getContent(), '<!--more-->')) {
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\\b[^>]*>(.*?)<\\/style>/s", "", $post->getContent())
), $match)) {
return $match[0];
}

return $post->getContent();
return $this->filterProvider->getPageFilter()->filter($post->getContent());
}

return '';
Expand Down
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)*

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
],
Expand Down

0 comments on commit c8a1a27

Please sign in to comment.