Escape place holders

This commit is contained in:
M66B 2021-06-26 09:53:18 +02:00
parent 6eed965e73
commit 58cad3f503
1 changed files with 6 additions and 4 deletions

View File

@ -19,6 +19,8 @@ package eu.faircode.email;
Copyright 2018-2021 by Marcel Bokhorst (M66B) Copyright 2018-2021 by Marcel Bokhorst (M66B)
*/ */
import android.text.Html;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.room.Entity; import androidx.room.Entity;
import androidx.room.PrimaryKey; import androidx.room.PrimaryKey;
@ -113,10 +115,10 @@ public class EntityAnswer implements Serializable {
} }
} }
text = text.replace("$name$", fullName == null ? "" : fullName); text = text.replace("$name$", fullName == null ? "" : Html.escapeHtml(fullName));
text = text.replace("$firstname$", first == null ? "" : first); text = text.replace("$firstname$", first == null ? "" : Html.escapeHtml(first));
text = text.replace("$lastname$", last == null ? "" : last); text = text.replace("$lastname$", last == null ? "" : Html.escapeHtml(last));
text = text.replace("$email$", email == null ? "" : email); text = text.replace("$email$", email == null ? "" : Html.escapeHtml(email));
return text; return text;
} }