From b851abc7fd41e81c9c39fb35c5d465925c2fa824 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 31 May 2023 15:21:49 +0300 Subject: [PATCH] Guard against '><' causing translation recursion --- core/src/com/unciv/models/translations/Translations.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/models/translations/Translations.kt b/core/src/com/unciv/models/translations/Translations.kt index 9ff727bd63..6c5d0fc364 100644 --- a/core/src/com/unciv/models/translations/Translations.kt +++ b/core/src/com/unciv/models/translations/Translations.kt @@ -299,7 +299,9 @@ object TranslationActiveModsCache { */ fun String.tr(hideIcons:Boolean = false): String { val language:String = UncivGame.Current.settings.language - if (contains('<') && contains('>')) { // Conditionals! + + // '<' and '>' checks for quick 'no' answer, regex to ensure that no one accidentally put '><' and ruined things + if (contains('<') && contains('>') && pointyBraceRegex.containsMatchIn(this)) { // Conditionals! /** * So conditionals can contain placeholders, such as , which themselves * can contain multiple filters, such as .