diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index fd6dc10df5..baf439dc02 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -481,7 +481,7 @@ class Feed { if (empty($taglist)) { $taglist = get_page_keywords($item["plink"], $preview, true, $contact["ffi_keyword_blacklist"]); } - /// @todo $item["body"] .= "\n" . $tags; + $item["body"] .= "\n" . self::tagToString($taglist); } else { $taglist = []; } @@ -527,6 +527,27 @@ class Feed { return ["header" => $author, "items" => $items]; } + /** + * Convert a tag array to a tag string + * + * @param array $tags + * @return string tag string + */ + private static function tagToString(array $tags) + { + $tagstr = ''; + + foreach ($tags as $tag) { + if ($tagstr != "") { + $tagstr .= ", "; + } + + $tagstr .= "#[url=" . DI::baseUrl() . "/search?tag=" . urlencode($tag) . "]" . $tag . "[/url]"; + } + + return $tagstr; + } + private static function titleIsBody($title, $body) { $title = strip_tags($title);