Possibly Issue 3611: Better feed handling when there is no body

This commit is contained in:
Michael 2017-08-27 06:59:07 +00:00
parent 4788c924a0
commit a36c8a0173
1 changed files with 12 additions and 0 deletions

View File

@ -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) {