]> git.mxchange.org Git - friendica.git/commitdiff
Fix missing mentions
authorMichael <heluecht@pirati.ca>
Tue, 2 Oct 2018 14:48:57 +0000 (14:48 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 2 Oct 2018 14:48:57 +0000 (14:48 +0000)
src/Model/Term.php

index 6042091c9b085b2cb4b57093f309de962242b002..854861ccb589b022609d48000a7b21f0d2ce286c 100644 (file)
@@ -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;