]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/Feed.php
Merge pull request #9146 from tobiasd/2020.09-CHANGELOG
[friendica.git] / src / Protocol / Feed.php
index 103f7a9f081f91b617d85518a38ab4b164bb7870..67baf4b2aebf6412945579c7d3ca8e3cdf654bd2 100644 (file)
@@ -494,6 +494,9 @@ class Feed
                        }
                        $item["body"] = HTML::toBBCode($body, $basepath);
 
+                       // Remove tracking pixels
+                       $item["body"] = preg_replace("/\[img=1x1\]([^\[\]]*)\[\/img\]/Usi", '', $item["body"]);
+
                        if (($item["body"] == '') && ($item["title"] != '')) {
                                $item["body"] = $item["title"];
                                $item["title"] = '';
@@ -554,7 +557,7 @@ class Feed
 
                                $data = PageInfo::queryUrl($item["plink"], false, $preview, ($contact["fetch_further_information"] == 2), $contact["ffi_keyword_denylist"] ?? '');
 
-                               // Take the data that was provided by the feed if the query wasn't empty
+                               // Take the data that was provided by the feed if the query is empty
                                if (($data['type'] == 'link') && empty($data['title']) && empty($data['text'])) {
                                        $data['title'] = $saved_title;
                                        $item["body"] = $saved_body;
@@ -563,7 +566,7 @@ class Feed
                                $data_text = strip_tags(trim($data['text'] ?? ''));
                                $item_body = strip_tags(trim($item['body'] ?? ''));
 
-                               if (($data_text == $item_body) || strstr($item_body, $data_text)) {
+                               if (!empty($data_text) && (($data_text == $item_body) || strstr($item_body, $data_text))) {
                                        $data['text'] = '';
                                }