diff options
| author | Shawn <shawn@qwil.io> | 2021-09-17 23:45:43 +0100 |
|---|---|---|
| committer | Shawn <shawn@qwil.io> | 2021-09-17 23:45:43 +0100 |
| commit | 12a3d2c5c3ad42b8b236117f9a767824d832cc3a (patch) | |
| tree | 88c24001b6fc9663e2581f23c22bc08f39f960a5 | |
| parent | 79ea47bc78f58d7c614e93abf3eadb97a001961d (diff) | |
Sanitize room name
| -rw-r--r-- | index.html | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |
