Merge pull request #12436 from MrPetovan/bug/notices

Address a few notices
This commit is contained in:
Philipp 2022-12-16 08:52:04 +01:00 committed by GitHub
commit 2ae3ae0b8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -2599,7 +2599,7 @@ class BBCode
// Bypass attachment if parse url for a comment
if (!$tryAttachment) {
DI::profiler()->stopRecording();
return "\n" . '[url=' . $url . ']' . $siteinfo['title'] . '[/url]';
return "\n" . '[url=' . $url . ']' . ($siteinfo['title'] ?? $url) . '[/url]';
}
// Format it as BBCode attachment

View file

@ -142,7 +142,7 @@ class Subscribe extends \Friendica\BaseModule
$o .= '<p>' . $counter . '/' . $total . ': ' . $url;
$probed = Contact::getByURL($url);
if (in_array($probed['network'], Protocol::FEDERATED)) {
if (!empty($probed['network']) && in_array($probed['network'], Protocol::FEDERATED)) {
$result = Contact::createFromProbeForUser($this->session->getLocalUserId(), $probed['url']);
if ($result['success']) {
$o .= ' - ' . $this->t('success');

View file

@ -377,7 +377,7 @@ class Photo extends BaseModule
$url = Contact::getDefaultAvatar($contact ?: [], Proxy::SIZE_SMALL);
}
}
return MPhoto::createPhotoForExternalResource($url, 0, $mimetext, $contact['blurhash'], $customsize, $customsize);
return MPhoto::createPhotoForExternalResource($url, 0, $mimetext, $contact['blurhash'] ?? null, $customsize, $customsize);
case 'header':
$fields = ['uid', 'url', 'header', 'network', 'gsid'];
$contact = Contact::getById($id, $fields);