]> git.mxchange.org Git - friendica.git/commitdiff
Remove the text if it is identical to the body
authorMichael <heluecht@pirati.ca>
Thu, 17 Sep 2020 13:07:20 +0000 (13:07 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 17 Sep 2020 13:07:20 +0000 (13:07 +0000)
src/Protocol/Feed.php

index 7ed94f9f14215e648129566e685dce893ecc6e72..f414a3ca8a3dc9e5c2121e759cfadcfe1cb22198 100644 (file)
@@ -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);