From: Hypolite Petovan Date: Tue, 15 Feb 2022 21:10:15 +0000 (-0500) Subject: Hash the URL before using it as cache key in Util\Images::getInfoFromURLCached X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=17d49422b4f7b3d1ed06859f996876a85028d87b;p=friendica.git Hash the URL before using it as cache key in Util\Images::getInfoFromURLCached - This prevents oversized URL from stunting the database cache --- diff --git a/src/Util/Images.php b/src/Util/Images.php index 077509d3cb..d7a58b52aa 100644 --- a/src/Util/Images.php +++ b/src/Util/Images.php @@ -184,12 +184,14 @@ class Images return $data; } - $data = DI::cache()->get($url); + $cacheKey = 'getInfoFromURL:' . sha1($url); + + $data = DI::cache()->get($cacheKey); if (empty($data) || !is_array($data)) { $data = self::getInfoFromURL($url); - DI::cache()->set($url, $data); + DI::cache()->set($cacheKey, $data); } return $data;