From d8f406390fa00e06472141b64b4cfd8823fe9af0 Mon Sep 17 00:00:00 2001 From: Mia <49593536+mia-pi-git@users.noreply.github.com> Date: Thu, 5 Oct 2023 13:05:38 -0500 Subject: [PATCH] Teambuilder: Disallow [ and ] in team names --- js/client-teambuilder.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/client-teambuilder.js b/js/client-teambuilder.js index a4bc14cc69..fa41f3b5d3 100644 --- a/js/client-teambuilder.js +++ b/js/client-teambuilder.js @@ -1539,6 +1539,11 @@ app.addPopupMessage("Names can't contain the character |, since they're used for storing teams."); name = name.replace(/\|/g, ''); } + if (name.indexOf('[') >= 0 || name.indexOf(']') >= 0) { + app.addPopupMessage("Names can't contain the characters [ or ], since they're used for storing team IDs."); + name = name.replace(/\[/g, ''); + name = name.replace(/\]/g, ''); + } this.curTeam.name = name; e.currentTarget.value = name; this.save();