X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fbbcode.php;h=c2ebf35e6308b7464359a8af2b3efe36d13628f7;hb=57c47a8e3660b8b968b36ff7b379f51aa398a684;hp=1f635e051b2304ab2cc16d040e9b5a6d20c15635;hpb=3195bacd9e4d3ba3e4d06c2533b9455e7658f5ed;p=friendica.git diff --git a/include/bbcode.php b/include/bbcode.php index 1f635e051b..c2ebf35e63 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -619,6 +619,17 @@ function GetProfileUsername($profile, $username, $compact = false, $getnetwork = return($username." (".$diaspora.")"); } + $red = preg_replace("=https?://(.*)/channel/(.*)=ism", "$2@$1", $profile); + if ($red != $profile) { + if ($getnetwork) + // red is identified as Diaspora - friendica can't connect directly to it + return(NETWORK_DIASPORA); + elseif ($compact) + return($red); + else + return($username." (".$red.")"); + } + $StatusnetHost = preg_replace("=https?://(.*)/user/(.*)=ism", "$1", $profile); if ($StatusnetHost != $profile) { $StatusnetUser = preg_replace("=https?://(.*)/user/(.*)=ism", "$2", $profile); @@ -697,7 +708,7 @@ function bb_RemovePictureLinks($match) { } function bb_expand_links($match) { - if (stristr($match[2], $match[3]) OR ($match[2] == $match[3])) + if (($match[3] == "") OR ($match[2] == $match[3]) OR stristr($match[2], $match[3])) return ($match[1]."[url]".$match[2]."[/url]"); else return ($match[1].$match[3]." [url]".$match[2]."[/url]");