From: Michael Date: Sun, 27 Aug 2017 06:59:07 +0000 (+0000) Subject: Possibly Issue 3611: Better feed handling when there is no body X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a36c8a01730561fb63568aeb4460049d397f075a;p=friendica.git Possibly Issue 3611: Better feed handling when there is no body --- diff --git a/include/feed.php b/include/feed.php index 1545ff34ce..91bbb286ed 100644 --- a/include/feed.php +++ b/include/feed.php @@ -338,12 +338,24 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) { if ($body == "") { $body = trim($xpath->evaluate('atom:summary/text()', $entry)->item(0)->nodeValue); } + // remove the content of the title if it is identically to the body // This helps with auto generated titles e.g. from tumblr if (title_is_body($item["title"], $body)) { $item["title"] = ""; } $item["body"] = html2bbcode($body); + + if ($item["body"] == "") { + if ($item["title"] != '') { + $item["body"] = $item["title"]; + $item["title"] = ''; + } + } + + if (!strstr($item["body"], '[url') && ($item['plink'] != '')) { + $item["body"] .= "\n[hr]\n[url]".$item['plink']."[/url]"; + } } if (!$simulate) {