mirror of
https://github.com/DirectoryLister/DirectoryLister.git
synced 2025-08-22 21:54:15 +02:00
Use sha1 for cache keys
This commit is contained in:
@@ -63,7 +63,7 @@ class FileInfoController
|
||||
}
|
||||
|
||||
$response->getBody()->write($this->cache->get(
|
||||
sprintf('file-info-%s', md5($file->getRealPath())),
|
||||
sprintf('file-info-%s', sha1($file->getRealPath())),
|
||||
function () use ($file): string {
|
||||
return json_encode(['hashes' => $this->calculateHashes($file)]);
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ class ZipController
|
||||
}
|
||||
|
||||
$response->getBody()->write(
|
||||
$this->cache->get(sprintf('zip-%s', md5($path)), function () use ($path): string {
|
||||
$this->cache->get(sprintf('zip-%s', sha1($path)), function () use ($path): string {
|
||||
return $this->createZip($path)->getContents();
|
||||
})
|
||||
);
|
||||
|
@@ -32,7 +32,7 @@ class Markdown extends ViewFunction
|
||||
public function __invoke(string $string): string
|
||||
{
|
||||
return $this->cache->get(
|
||||
sprintf('markdown-%s', md5($string)),
|
||||
sprintf('markdown-%s', sha1($string)),
|
||||
function () use ($string): string {
|
||||
return $this->parser->parse($string);
|
||||
}
|
||||
|
Reference in New Issue
Block a user