summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorb_b <bruno@eliaz.fr>2019-11-16 14:21:40 +0100
committerBenjamin Brahmer <info@b-brahmer.de>2019-11-16 14:21:40 +0100
commit35c6c91e26d2fb34b01d78ce471c4d386c23fd35 (patch)
treeda06d4d31228aaabef9ed21804c3f9156d6af99e
parent7664983334f06e2f98ceb6f1b14bb885da737887 (diff)
Get content:encoded of item if available (#565)
Get content:encoded of item if available fixes #564 Signed-off-by: brunob <bruno@eliaz.fr>
-rwxr-xr-xlib/Fetcher/FeedFetcher.php2
-rw-r--r--tests/Unit/Fetcher/FeedFetcherTest.php4
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(