From 1a922d41df391826062f7da41fc7a88e4b76ae39 Mon Sep 17 00:00:00 2001 From: jade <74706690+jadelily18@users.noreply.github.com> Date: Tue, 6 Dec 2022 17:13:18 -0600 Subject: [PATCH] Fix modal URL field autofill allowing invalid characters (#790) Closes #785 --- components/ui/ModalCreation.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/ui/ModalCreation.vue b/components/ui/ModalCreation.vue index e02d3a2ea..64fe9ef15 100644 --- a/components/ui/ModalCreation.vue +++ b/components/ui/ModalCreation.vue @@ -221,7 +221,10 @@ Questions? [Join the Modrinth Discord for support!](https://discord.gg/EUHuJHt)` }, updatedName() { if (!this.manualSlug) { - this.slug = this.name.toLowerCase().replaceAll(' ', '-') + this.slug = this.name + .toLowerCase() + .replaceAll(' ', '-') + .replaceAll(/[^a-zA-Z0-9!@$()`.+,_"-]/g, '') } }, },