π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Constrain year search queries
ashil-pilotf9380de9d7b7
diff --git a/mobile/apps/photos/lib/ui/viewer/search/search_query_utils.dart b/mobile/apps/photos/lib/ui/viewer/search/search_query_utils.dartindex 7e344f2f8b..a3587f1dcd 100644--- a/mobile/apps/photos/lib/ui/viewer/search/search_query_utils.dart+++ b/mobile/apps/photos/lib/ui/viewer/search/search_query_utils.dart@@ -1,6 +1,13 @@import "package:ente_pure_utils/ente_pure_utils.dart";+const _minimumSearchYear = 1900;+bool isYearSearchQuery(String query) {+ if (query.length != 4) {+ return false;+ }final yearAsInt = int.tryParse(query);- return yearAsInt != null && yearAsInt <= currentYear;+ return yearAsInt != null &&+ yearAsInt >= _minimumSearchYear &&+ yearAsInt <= currentYear;}