diff options
author | Thomas Citharel <tcit@tcit.fr> | 2022-04-24 16:48:50 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2022-04-24 16:59:29 +0200 |
commit | 1b11e81c5b12e0641748e7459fab0246b194be40 (patch) | |
tree | 4e4fa5b5ff8b2d7d07ca8afce9a9fb912a892ea8 /lib | |
parent | a84d7fa7ce66839a0e44934faf652e8c3a69fc23 (diff) |
Make sure URLs for social avatars of contacts are actual URLs
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Service/SocialApiService.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Service/SocialApiService.php b/lib/Service/SocialApiService.php index b7a4d3a8..089b5dad 100644 --- a/lib/Service/SocialApiService.php +++ b/lib/Service/SocialApiService.php @@ -200,7 +200,9 @@ class SocialApiService { } foreach ($connectors as $connector) { - $urls = array_merge($connector->getImageUrls($contact), $urls); + $urls = array_filter(array_merge($connector->getImageUrls($contact), $urls), function ($url) { + return filter_var($url, FILTER_VALIDATE_URL) !== false; + }); } if (count($urls) == 0) { |