Avoid more local links and bad http requests

This commit is contained in:
Michael 2023-01-28 14:57:04 +00:00
parent fc46778a00
commit 999cdc7db9
11 changed files with 62 additions and 81 deletions

View file

@ -368,10 +368,13 @@ class APContact
// Unhandled from Kroeg
// kroeg:blocks, updated
if (!empty($apcontact['photo'])) {
$apcontact['photo'] = trim($apcontact['photo']);
}
if (!empty($apcontact['photo']) && !Network::isValidHttpUrl($apcontact['photo'])) {
Logger::info('Invalid URL for photo', ['url' => $apcontact['url'], 'photo' => $apcontact['photo']]);
$apcontact['photo'] = null;
Logger::warning('Invalid URL for photo', ['url' => $apcontact['url'], 'photo' => $apcontact['photo']]);
$apcontact['photo'] = '';
}
// When the photo is too large, try to shorten it by removing parts