From 071ffd43bf66ff6478c09a4afc6ef010e34d8384 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 16 Mar 2016 11:44:45 +0100 Subject: [PATCH] DFRN: Mentions were imported as hash tags --- include/dfrn.php | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/include/dfrn.php b/include/dfrn.php index ad04a91295..1c5ac2b012 100644 --- a/include/dfrn.php +++ b/include/dfrn.php @@ -2022,14 +2022,28 @@ class dfrn { $categories = $xpath->query("atom:category", $entry); if ($categories) { foreach ($categories AS $category) { - foreach($category->attributes AS $attributes) - if ($attributes->name == "term") { + $term = ""; + $scheme = ""; + foreach($category->attributes AS $attributes) { + if ($attributes->name == "term") $term = $attributes->textContent; + + if ($attributes->name == "scheme") + $scheme = $attributes->textContent; + } + + if (($term != "") AND ($scheme != "")) { + $parts = explode(":", $scheme); + if ((count($parts) >= 4) AND (array_shift($parts) == "X-DFRN")) { + $termhash = array_shift($parts); + $termurl = implode(":", $parts); + if(strlen($item["tag"])) $item["tag"] .= ","; - $item["tag"] .= "#[url=".App::get_baseurl()."/search?tag=".$term."]".$term."[/url]"; + $item["tag"] .= $termhash."[url=".$termurl."]".$term."[/url]"; } + } } } -- 2.39.5