From 3020b0fdc4f4ccdfc1deccc23b8748066a7c9979 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 2 Oct 2018 14:48:57 +0000 Subject: [PATCH] Fix missing mentions --- src/Model/Term.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/Model/Term.php b/src/Model/Term.php index 6042091c9b..854861ccb5 100644 --- a/src/Model/Term.php +++ b/src/Model/Term.php @@ -110,6 +110,18 @@ class Term $pattern = '/\W([\#@])\[url\=(.*?)\](.*?)\[\/url\]/ism'; if (preg_match_all($pattern, $data, $matches, PREG_SET_ORDER)) { foreach ($matches as $match) { + + if ($match[1] == '@') { + $contact = Contact::getDetailsByURL($match[2], 0); + if (!empty($contact['addr'])) { + $match[3] = $contact['addr']; + } + + if (!empty($contact['url'])) { + $match[2] = $contact['url']; + } + } + $tags[$match[1] . trim($match[3], ',.:;[]/\"?!')] = $match[2]; } } @@ -137,10 +149,6 @@ class Term } else { $term = substr($tag, 1); } - - if (!empty($contact['url'])) { - $link = $contact['url']; - } } else { // This shouldn't happen $type = TERM_HASHTAG; $term = $tag; -- 2.39.5