Fix several notices

This commit is contained in:
Michael 2022-04-11 18:57:30 +00:00
parent 3842f02b02
commit 62367923e0
3 changed files with 12 additions and 6 deletions

View file

@ -493,9 +493,13 @@ class GServer
// Detect the directory type // Detect the directory type
$serverdata['directory-type'] = self::DT_NONE; $serverdata['directory-type'] = self::DT_NONE;
$serverdata = self::checkPoCo($url, $serverdata);
$serverdata = self::checkMastodonDirectory($url, $serverdata); $serverdata = self::checkMastodonDirectory($url, $serverdata);
if ($serverdata['directory-type'] == self::DT_NONE) {
$serverdata = self::checkPoCo($url, $serverdata);
}
// We can't detect the network type. Possibly it is some system that we don't know yet // We can't detect the network type. Possibly it is some system that we don't know yet
if (empty($serverdata['network'])) { if (empty($serverdata['network'])) {
$serverdata['network'] = Protocol::PHANTOM; $serverdata['network'] = Protocol::PHANTOM;
@ -1350,7 +1354,7 @@ class GServer
$contact = Contact::selectFirst(['id'], ['uid' => 0, 'failed' => false, 'gsid' => $gserver['id']]); $contact = Contact::selectFirst(['id'], ['uid' => 0, 'failed' => false, 'gsid' => $gserver['id']]);
// Via probing we can be sure that the server is responding // Via probing we can be sure that the server is responding
if (Contact::updateFromProbe($contact['id'])) { if (!empty($contact['id']) && Contact::updateFromProbe($contact['id'])) {
$contact = Contact::selectFirst(['network', 'failed'], ['id' => $contact['id']]); $contact = Contact::selectFirst(['network', 'failed'], ['id' => $contact['id']]);
if (!$contact['failed'] && in_array($contact['network'], Protocol::FEDERATED)) { if (!$contact['failed'] && in_array($contact['network'], Protocol::FEDERATED)) {
$serverdata['network'] = $contact['network']; $serverdata['network'] = $contact['network'];

View file

@ -1002,6 +1002,8 @@ class Processor
$posts = Post\Collection::selectToArrayForContact($pcid, Post\Collection::FEATURED); $posts = Post\Collection::selectToArrayForContact($pcid, Post\Collection::FEATURED);
if (!empty($posts)) { if (!empty($posts)) {
$old_featured = array_column($posts, 'uri-id'); $old_featured = array_column($posts, 'uri-id');
} else {
$old_featured = [];
} }
$featured = ActivityPub::fetchItems($apcontact['featured']); $featured = ActivityPub::fetchItems($apcontact['featured']);

View file

@ -4101,10 +4101,10 @@ class Diaspora
'author-id' => $author, 'author-id' => $author,
'owner-id' => $author, 'owner-id' => $author,
'body' => $post, 'body' => $post,
'allow_cid' => $owner['allow_cid'], 'allow_cid' => $owner['allow_cid'] ?? '',
'allow_gid' => $owner['allow_gid'], 'allow_gid' => $owner['allow_gid']?? '',
'deny_cid' => $owner['deny_cid'], 'deny_cid' => $owner['deny_cid'] ?? '',
'deny_gid' => $owner['deny_gid'], 'deny_gid' => $owner['deny_gid'] ?? '',
]; ];
if (!empty($item['allow_cid'] . $item['allow_gid'] . $item['deny_cid'] . $item['deny_gid'])) { if (!empty($item['allow_cid'] . $item['allow_gid'] . $item['deny_cid'] . $item['deny_gid'])) {