1
0
Fork 0

Merge pull request #12735 from MrPetovan/bug/fatal-errors

Address a couple of Fatal errors
This commit is contained in:
Michael Vogel 2023-01-27 08:55:27 +01:00 committed by GitHub
commit fc46778a00
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -583,7 +583,7 @@ class Photo
$photo_failure = false;
$filename = basename($image_url);
if (!empty($image_url)) {
if (!empty($image_url) && @parse_url($image_url, PHP_URL_HOST)) {
$ret = DI::httpClient()->get($image_url, HttpClientAccept::IMAGE);
Logger::debug('Got picture', ['Content-Type' => $ret->getHeader('Content-Type'), 'url' => $image_url]);
$img_str = $ret->getBody();