Browse Source

Left trim at sign from nicks in ACL

pull/3319/head
Hypolite Petovan 6 years ago
parent
commit
05a5e1792d
  1. 12
      include/acl_selectors.php
  2. 2
      mod/acl.php

12
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),

2
mod/acl.php

@ -1,7 +1,7 @@
<?php
/* ACL selector json backend */
require_once("include/acl_selectors.php");
require_once 'include/acl_selectors.php';
function acl_init(App $a) {
acl_lookup($a);

Loading…
Cancel
Save