Check link after fetching page as well

This commit is contained in:
Jake Barnby 2023-08-30 02:14:19 -04:00
parent 085b50be8b
commit ff16fd7d9c
No known key found for this signature in database
GPG key ID: C437A8CC85B96E9C

View file

@ -412,6 +412,12 @@ App::get('/v1/avatars/favicon')
$outputExt = 'ico';
}
$domain = new Domain(\parse_url($outputHref, PHP_URL_HOST));
if (!$domain->isKnown()) {
throw new Exception(Exception::AVATAR_REMOTE_URL_FAILED);
}
if ('ico' == $outputExt) { // Skip crop, Imagick isn\'t supporting icon files
$data = @\file_get_contents($outputHref, false);