From 35c6c91e26d2fb34b01d78ce471c4d386c23fd35 Mon Sep 17 00:00:00 2001 From: b_b Date: Sat, 16 Nov 2019 14:21:40 +0100 Subject: [PATCH] Get content:encoded of item if available (#565) Get content:encoded of item if available fixes #564 Signed-off-by: brunob --- lib/Fetcher/FeedFetcher.php | 2 +- tests/Unit/Fetcher/FeedFetcherTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Fetcher/FeedFetcher.php b/lib/Fetcher/FeedFetcher.php index f433ac224..1fbce123f 100755 --- a/lib/Fetcher/FeedFetcher.php +++ b/lib/Fetcher/FeedFetcher.php @@ -198,7 +198,7 @@ class FeedFetcher implements IFeedFetcher } // purification is done in the service layer - $body = $parsedItem->getDescription(); + $body = $parsedItem->getValue("content:encoded") ?? $parsedItem->getDescription(); $body = mb_convert_encoding( $body, 'HTML-ENTITIES', diff --git a/tests/Unit/Fetcher/FeedFetcherTest.php b/tests/Unit/Fetcher/FeedFetcherTest.php index 72badf093..397007876 100644 --- a/tests/Unit/Fetcher/FeedFetcherTest.php +++ b/tests/Unit/Fetcher/FeedFetcherTest.php @@ -405,7 +405,7 @@ class FeedFetcherTest extends TestCase $this->createFeed('he-IL'); $this->createItem(); - $this->item_mock->expects($this->exactly(2)) + $this->item_mock->expects($this->exactly(3)) ->method('getValue') ->will( $this->returnValueMap( @@ -431,7 +431,7 @@ class FeedFetcherTest extends TestCase $this->createFeed('he-IL'); $this->createItem(); - $this->item_mock->expects($this->exactly(3)) + $this->item_mock->expects($this->exactly(4)) ->method('getValue') ->will( $this->returnValueMap(