mirror of
https://github.com/friendica/friendica
synced 2024-11-18 21:43:40 +00:00
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:
commit
4c39faca95
1 changed files with 4 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue