Avoid local network communication / invalid url requests

This commit is contained in:
Michael 2023-01-27 05:55:45 +00:00
parent 6bedd190b9
commit ba4860b787
12 changed files with 96 additions and 105 deletions

View file

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