]> git.mxchange.org Git - friendica.git/blobdiff - include/text.php
Merge branch 'master' into develop
[friendica.git] / include / text.php
index 6e2fb33bba5525ba38fff19e42b459e52decafd9..53eae1ff33924f7118df4c5f8beb3714743628c0 100644 (file)
@@ -14,6 +14,7 @@ use Friendica\Core\L10n;
 use Friendica\Core\PConfig;
 use Friendica\Core\System;
 use Friendica\Database\DBM;
+use Friendica\Model\Contact;
 use Friendica\Model\Event;
 use Friendica\Model\Item;
 use Friendica\Model\Profile;
@@ -1966,6 +1967,10 @@ function undo_post_tagging($s) {
        $cnt = preg_match_all('/([!#@])\[url=(.*?)\](.*?)\[\/url\]/ism', $s, $matches, PREG_SET_ORDER);
        if ($cnt) {
                foreach ($matches as $mtch) {
+                       if (in_array($mtch[1], ['!', '@'])) {
+                               $contact = Contact::getDetailsByURL($mtch[2]);
+                               $mtch[3] = empty($contact['addr']) ? $mtch[2] : $contact['addr'];
+                       }
                        $s = str_replace($mtch[0], $mtch[1] . $mtch[3],$s);
                }
        }