From 759b80698aa5c4aed4e44706d660b94a349435f3 Mon Sep 17 00:00:00 2001 From: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Date: Sat, 30 Aug 2025 04:04:27 +0200 Subject: [PATCH] improve regex --- static/webui/script.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static/webui/script.js b/static/webui/script.js index 8d5f08af..c065be5b 100644 --- a/static/webui/script.js +++ b/static/webui/script.js @@ -2018,7 +2018,8 @@ function doAcquireMiscItems() { function addItemByItemType() { const ItemType = document.getElementById("typeName-type").value; - if (!ItemType || !/^[A-Za-z/]+$/.test(ItemType) || !ItemType.startsWith("/Lotus/")) { + // Must start with "/Lotus/", contain only A–Z letters, no "//", and not end with "/" + if (!ItemType || !/^\/Lotus\/(?:[A-Za-z]+(?:\/[A-Za-z]+)*)$/.test(ItemType)) { $("#typeName-type").addClass("is-invalid").focus(); return; }