From: Michael Date: Tue, 17 Oct 2017 09:58:29 +0000 (+0000) Subject: Better rule to replace content X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9c5cd476dd718f3bd4b6dc7b43f53fa61904a193;p=friendica.git Better rule to replace content --- diff --git a/include/feed.php b/include/feed.php index 6c0b3b145a..11ccd6af27 100644 --- a/include/feed.php +++ b/include/feed.php @@ -353,7 +353,20 @@ function feed_import($xml,$importer,&$contact, &$hub, $simulate = false) { } } - if (strlen($item["title"]) > strlen($item["body"])) { + // Replace the content when the title is longer than the body + $replace = (strlen($item["title"]) > strlen($item["body"])); + + // Replace it, when there is an image in the body + if (strstr($item["body"], '[/img]')) { + $replace = true; + } + + // Replace it, when there is a link in the body + if (strstr($item["body"], '[/url]')) { + $replace = true; + } + + if ($replace) { $item["body"] = $item["title"]; $item["title"] = ""; }