mirror of
https://github.com/friendica/friendica
synced 2024-11-18 03:43:40 +00:00
Use data from contact and gcontact prior to probe_url
This commit is contained in:
parent
af37fa8293
commit
1aa6c1dc5b
1 changed files with 13 additions and 1 deletions
12
mod/item.php
12
mod/item.php
|
@ -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)) {
|
||||
|
||||
$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)) {
|
||||
|
|
Loading…
Reference in a new issue