Merge pull request #14550 from annando/log-warning

Avoid useless "warning" logging
pull/14549/head
Hypolite Petovan 2024-11-12 08:14:49 -05:00 committed by GitHub
commit cf220928c6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -2301,7 +2301,7 @@ class Contact
return; return;
} }
if (!Network::isValidHttpUrl($avatar)) { if (!empty($avatar) && !Network::isValidHttpUrl($avatar)) {
Logger::warning('Invalid avatar', ['cid' => $cid, 'avatar' => $avatar]); Logger::warning('Invalid avatar', ['cid' => $cid, 'avatar' => $avatar]);
$avatar = ''; $avatar = '';
} }

View File

@ -877,10 +877,10 @@ class Processor
{ {
if (!empty($activity['mediatype']) && ($activity['mediatype'] == 'text/markdown')) { if (!empty($activity['mediatype']) && ($activity['mediatype'] == 'text/markdown')) {
$item['title'] = strip_tags($activity['name'] ?? ''); $item['title'] = strip_tags($activity['name'] ?? '');
$content = Markdown::toBBCode($activity['content']); $content = Markdown::toBBCode($activity['content'] ?? '');
} elseif (!empty($activity['mediatype']) && ($activity['mediatype'] == 'text/bbcode')) { } elseif (!empty($activity['mediatype']) && ($activity['mediatype'] == 'text/bbcode')) {
$item['title'] = $activity['name']; $item['title'] = $activity['name'] ?? '';
$content = $activity['content']; $content = $activity['content'] ?? '';
} else { } else {
// By default assume "text/html" // By default assume "text/html"
$item['title'] = HTML::toBBCode($activity['name'] ?? ''); $item['title'] = HTML::toBBCode($activity['name'] ?? '');