]> git.mxchange.org Git - friendica.git/commitdiff
Use data from contact and gcontact prior to probe_url
authorMichael Vogel <icarus@dabo.de>
Mon, 25 Apr 2016 19:35:42 +0000 (21:35 +0200)
committerRoland Haeder <roland@mxchange.org>
Sun, 1 May 2016 11:48:52 +0000 (13:48 +0200)
mod/item.php

index 86940cd69b9e917eb5eb48c633540d49a6e99500..215e3bc958cb720bb31d944db999124097d06735 100644 (file)
@@ -1095,7 +1095,19 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag, $netwo
                        // Checking for the alias that is used for OStatus
                        $pattern = "/@\[url\=(.*?)\](.*?)\[\/url\]/ism";
                        if (preg_match($pattern, $tag, $matches)) {
-                               $data = probe_url($matches[1]);
+
+                               $r = q("SELECT `alias`, `name` FROM `contact` WHERE `nurl` = '%s' AND `alias` != '' AND `uid` = 0",
+                                       normalise_link($matches[1]));
+                               if (!$r)
+                                       $r = q("SELECT `alias`, `name` FROM `gcontact` WHERE `nurl` = '%s' AND `alias` != ''",
+                                               normalise_link($matches[1]));
+                               if ($r)
+                                       $data = $r[0];
+                               else {
+                                       $data = probe_url($matches[1]);
+                                       logger("probe_url ".$matches[1]);
+                               }
+
                                if ($data["alias"] != "") {
                                        $newtag = '@[url='.$data["alias"].']'.$data["name"].'[/url]';
                                        if(!stristr($str_tags,$newtag)) {