From e1e7a2e497ea1bf3925c4a21c7f096b2a8c7e462 Mon Sep 17 00:00:00 2001 From: Sander Dorigo Date: Thu, 31 Jul 2025 11:32:31 +0200 Subject: [PATCH] Update file --- app/Repositories/Tag/TagRepository.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Repositories/Tag/TagRepository.php b/app/Repositories/Tag/TagRepository.php index ad3ada6789..4210f5cdd4 100644 --- a/app/Repositories/Tag/TagRepository.php +++ b/app/Repositories/Tag/TagRepository.php @@ -140,8 +140,9 @@ class TagRepository implements TagRepositoryInterface, UserGroupInterface } if (null !== $year) { + $year = min(2038,max(1970, $year)); app('log')->debug(sprintf('Get tags with year %s.', $year)); - $tagQuery->where('tags.date', '>=', $year.'-01-01 00:00:00')->where('tags.date', '<=', $year.'-12-31 23:59:59'); + $tagQuery->where('tags.date', '>=', sprintf('%d-01-01 00:00:00', $year))->where('tags.date', '<=', sprintf('%d-12-31 23:59:59', $year)); } $collection = $tagQuery->get(); $return = [];