From 1bbad87ff082c6fc77dbbdeac2a824f02dd98757 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 17 Sep 2020 13:07:20 +0000 Subject: [PATCH] Remove the text if it is identical to the body --- src/Protocol/Feed.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 7ed94f9f14..f414a3ca8a 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -560,6 +560,13 @@ class Feed $item["body"] = $saved_body; } + $data_text = strip_tags(trim($data['text'] ?? '')); + $item_body = strip_tags(trim($item['body'] ?? '')); + + if (!empty($data['text']) && (($data_text == $item_body) || strstr($item_body, $data_text))) { + $data['text'] = ''; + } + // We always strip the title since it will be added in the page information $item["title"] = ""; $item["body"] = $item["body"] . "\n" . PageInfo::getFooterFromData($data, false);