summaryrefslogtreecommitdiff
path: root/index.html
diff options
context:
space:
mode:
authorShawn <shawn@qwil.io>2021-09-17 23:45:43 +0100
committerShawn <shawn@qwil.io>2021-09-17 23:45:43 +0100
commit12a3d2c5c3ad42b8b236117f9a767824d832cc3a (patch)
tree88c24001b6fc9663e2581f23c22bc08f39f960a5 /index.html
parent79ea47bc78f58d7c614e93abf3eadb97a001961d (diff)
Sanitize room name
Diffstat (limited to 'index.html')
-rw-r--r--index.html4
1 files changed, 3 insertions, 1 deletions
diff --git a/index.html b/index.html
index 8763b15..6f0d102 100644
--- a/index.html
+++ b/index.html
@@ -35,7 +35,9 @@
$('#roomName')
.val(DEFAULT_ROOM_NAME)
.on("input", function () {
- generator.updateRoomName(this.value);
+ let value = this.value.replace(/\W/g, ''); // sanitize
+ this.value = value;
+ generator.updateRoomName(value);
});
// Regenerate random room name