Merge pull request #11249 from MrPetovan/bug/11248-getinfofromurl-cache-key

Hash the URL before using it as cache key in Util\Images::getInfoFromURLCached
This commit is contained in:
Michael Vogel 2022-02-18 17:53:20 +01:00 committed by GitHub
commit 4c39faca95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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;