From: Michael Vogel Date: Tue, 22 Apr 2014 22:34:34 +0000 (+0200) Subject: Bugfixes: 1. When posting shared feeds to Diaspora, the link vanished/2. The profile... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=acb57482215a7e5fcfb555459530ba54e66a6483;p=friendica.git Bugfixes: 1. When posting shared feeds to Diaspora, the link vanished/2. The profile name detection had problems with feeds --- diff --git a/include/bbcode.php b/include/bbcode.php index 308cbf1be1..d1cb1a9110 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -55,8 +55,8 @@ function bb_cleanup_share($shared) { if (strpos($shared[1],$title) !== false) $title = ""; - if (strpos($shared[1],$link) !== false) - $link = ""; +// if (strpos($shared[1],$link) !== false) +// $link = ""; $text = trim($shared[1]); @@ -555,10 +555,13 @@ function GetProfileUsername($profile, $username) { } } - // To-Do: Better check for pumpio - $pumpio = preg_replace("=https?://([^/]*).*/(\w*)=ism", "$2@$1", $profile); - if ($pumpio != $profile) - return($username." (".$pumpio.")"); + // pumpio (http://host.name/user) + $rest = preg_replace("=https?://([\.\w]+)/([\.\w]+)(.*)=ism", "$3", $profile); + if ($rest == "") { + $pumpio = preg_replace("=https?://([\.\w]+)/([\.\w]+)(.*)=ism", "*$2@$1*", $profile); + if ($pumpio != $profile) + return($username." (".$pumpio.")"); + } return($username); }