From: Hypolite Petovan Date: Tue, 11 Apr 2017 02:09:49 +0000 (-0400) Subject: Left trim at sign from nicks in ACL X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=05a5e1792d27184d29e0c78fd9c61334232a507e;p=friendica.git Left trim at sign from nicks in ACL --- diff --git a/include/acl_selectors.php b/include/acl_selectors.php index f4b644d68f..8404c8f4b6 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -627,14 +627,14 @@ function acl_lookup(App $a, $out_type = 'json') { dbesc($search), implode("','", $known_contacts) ); - if (dbm::is_result($r)){ + if (dbm::is_result($r)) { foreach ($r as $row) { - // nickname.. $up = parse_url($row['author-link']); - $nick = explode("/",$up['path']); - $nick = $nick[count($nick)-1]; - $nick .= "@".$up['host']; - // /nickname + $nick = explode('/', $up['path']); + // Fix for Mastodon URLs with format https://domain.tld/@nick + $nick = ltrim($nick[count($nick) - 1], '@'); + $nick .= '@' . $up['host']; + $unknow_contacts[] = array( 'type' => 'c', 'photo' => proxy_url($row['author-avatar'], false, PROXY_SIZE_MICRO), diff --git a/mod/acl.php b/mod/acl.php index 04aa9f50a6..9220bc77a9 100644 --- a/mod/acl.php +++ b/mod/acl.php @@ -1,7 +1,7 @@