Merge branch 'dev' of /home/macgirvin/roadhouse into dev

This commit is contained in:
nobody 2021-03-12 14:39:25 -08:00
commit 5827d073d1
5 changed files with 24 additions and 22 deletions

View file

@ -1796,10 +1796,11 @@ class Activity {
}
}
}
else
else {
$icon = $person_obj['icon'];
}
if (! $icon) {
}
if (! (isset($icon) && $icon)) {
$icon = z_root() . '/' . get_default_profile_photo();
}

View file

@ -481,7 +481,7 @@ class ActivityPub {
}
}
}
if ($person_obj) {
if (isset($person_obj)) {
Activity::actor_store($person_obj['id'],$person_obj, $force);
return $person_obj['id'];
}

View file

@ -361,7 +361,7 @@ class Connedit extends Controller {
intval(local_channel())
);
if(! $orig_record) {
if (! $orig_record) {
notice( t('Could not access address book record.') . EOL);
goaway(z_root() . '/connections');
}
@ -374,17 +374,15 @@ class Connedit extends Controller {
goaway(z_root() . '/connedit/' . $contact_id);
}
if($cmd === 'fetchvc') {
if ($cmd === 'fetchvc') {
$url = str_replace('/channel/','/profile/',$orig_record['xchan_url']) . '/vcard';
$recurse = 0;
$x = z_fetch_url(zid($url),false,$recurse,['session' => true]);
if ($x['success']) {
$h = new HTTPHeaders($x['header']);
$fields = $h->fetch();
if ($fields) {
foreach ($fields as $y) {
if (array_key_exists('content-type',$y)) {
$type = explode(';',trim($y['content-type']));
$fields = $h->fetcharr();
if ($fields && array_key_exists('content-type',$fields)) {
$type = explode(';',trim($fields['content-type']));
if ($type && $type[0] === 'text/vcard' && $x['body']) {
$vc = Reader::read($x['body']);
$vcard = $vc->serialize();
@ -395,8 +393,6 @@ class Connedit extends Controller {
}
}
}
}
}
goaway(z_root() . '/connedit/' . $contact_id);
}
@ -496,7 +492,7 @@ class Connedit extends Controller {
Libsync::build_sync_packet(0, [ 'abook' => [ 'abook_xchan' => $orig_record['abook_xchan'], 'entry_deleted' => true ] ] );
info( t('Connection has been removed.') . EOL );
if (x($_SESSION,'return_url')) {
if (isset($_SESSION['return_url']) && $_SESSION['return_url']) {
goaway(z_root() . '/' . $_SESSION['return_url']);
}
goaway(z_root() . '/contacts');
@ -626,7 +622,6 @@ class Connedit extends Controller {
];
}
$sections = [];
$sections['perms'] = [

View file

@ -51,7 +51,6 @@ class HTTPHeaders {
}
}
}
logger('fetcharr: ' . print_r($ret,true));
return $ret;
}

View file

@ -367,7 +367,14 @@ function import_remote_xchan_photo($photo, $xchan, $thing = false) {
if ($result['success']) {
$type = guess_image_type($photo, $result['header']);
if ((! $type) || strpos($type,'image') === false) {
@file_put_contents('cache/' . $hash, $result['body']);
$info = getimagesize('cache/' . $hash);
@unlink('cache/' . $hash);
if (isset($info) && array_key_exists('mime',$info)) {
$type = $info['mime'];
}
}
if ($type) {
$failed = false;
}