From 71a1144680736d68f6bda2f8d0ab75890038d114 Mon Sep 17 00:00:00 2001 From: Nathan Cannon Date: Mon, 19 Jul 2021 15:13:49 +0100 Subject: [PATCH] Added more csv character escaping --- .../src/main/kotlin/uk/co/neviyn/observationdatabase/Entity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Entity.kt b/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Entity.kt index fd39941..88364fb 100644 --- a/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Entity.kt +++ b/backend/src/main/kotlin/uk/co/neviyn/observationdatabase/Entity.kt @@ -95,7 +95,7 @@ data class Observation( fun escapeSpecialCharacters(data: String): String { return data.replace("\"", "\"\"").replace("\n", ";") } - val dataPortion = "${date.toString("dd/MM/yyyy")},\"$person, ${type.name} ${scenarios.joinToString { it.title }}\"," + + val dataPortion = "${date.toString("dd/MM/yyyy")},\"${escapeSpecialCharacters(person)}, ${type.name} ${scenarios.joinToString { escapeSpecialCharacters(it.title) }}\"," + "\"Training\",\"Operations - Shift Operations\",\"${site.name}\",\"N/A\"," + "${roundScore(monitoring)},${roundScore(controlProcedural)},${roundScore(control)}," + "${roundScore(conservatism)},${roundScore(teamworkCommunications)},${roundScore(teamworkLeadership)}," +