From 9257354ca4f6907b31e4a5bd0fd0a3eea4b16e63 Mon Sep 17 00:00:00 2001 From: Patrick Schneider Date: Tue, 17 Sep 2024 21:01:49 +0200 Subject: [PATCH] [bug] fixes a template-injection in the checklist preview. --- .../privacyfriendlynotes/ui/main/MainActivityViewModel.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/secuso/privacyfriendlynotes/ui/main/MainActivityViewModel.kt b/app/src/main/java/org/secuso/privacyfriendlynotes/ui/main/MainActivityViewModel.kt index 7ec0641..521780f 100644 --- a/app/src/main/java/org/secuso/privacyfriendlynotes/ui/main/MainActivityViewModel.kt +++ b/app/src/main/java/org/secuso/privacyfriendlynotes/ui/main/MainActivityViewModel.kt @@ -245,7 +245,7 @@ class MainActivityViewModel(application: Application) : AndroidViewModel(applica throw IllegalArgumentException("Only checklist notes allowed") } return ChecklistUtil.parse(note.content).map { (checked, name) -> - return@map Pair(checked, String.format("[%s] $name", if (checked) "x" else " ")) + return@map Pair(checked, "[${if (checked) "x" else " "}] $name") } }