mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix various code.
This commit is contained in:
@@ -23,10 +23,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Support;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use JsonException;
|
||||
|
||||
use function Safe\json_encode;
|
||||
|
||||
/**
|
||||
* Class CacheProperties.
|
||||
*/
|
||||
@@ -80,10 +83,10 @@ class CacheProperties
|
||||
$content = '';
|
||||
foreach ($this->properties as $property) {
|
||||
try {
|
||||
$content = sprintf('%s%s', $content, \Safe\json_encode($property, JSON_THROW_ON_ERROR));
|
||||
$content = sprintf('%s%s', $content, json_encode($property, JSON_THROW_ON_ERROR));
|
||||
} catch (JsonException) {
|
||||
// @ignoreException
|
||||
$content = sprintf('%s%s', $content, hash('sha256', (string) time()));
|
||||
$content = sprintf('%s%s', $content, hash('sha256', (string) Carbon::now()->getTimestamp()));
|
||||
}
|
||||
}
|
||||
$this->hash = substr(hash('sha256', $content), 0, 16);
|
||||
|
Reference in New Issue
Block a user