]> git.mxchange.org Git - friendica.git/commitdiff
Check the image URL has a host before retrieving it in Photo::importProfilePhoto
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 26 Jan 2023 03:31:07 +0000 (22:31 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 26 Jan 2023 03:31:07 +0000 (22:31 -0500)
- Address https://github.com/friendica/friendica/issues/12486#issuecomment-1404324012

src/Model/Photo.php

index 9623f5622eabf849292bd45f25bae99c82136306..bf2f7bb8e301baa3dd20de90475a13ccc7f28572 100644 (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();