From 5a95bc3aa1649523104b17685ef53b3fc71574ce Mon Sep 17 00:00:00 2001 From: berrymot Date: Sun, 17 Dec 2023 15:19:12 -0800 Subject: [PATCH] stricter globs --- events.js | 2 +- worker.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/events.js b/events.js index 737779c..885e4a6 100644 --- a/events.js +++ b/events.js @@ -119,7 +119,7 @@ id("search").addEventListener("input", function() { createHTMLElement("a", {"href": "?q=" + encodeURIComponent(getConflictRegex(q)) + "®ex=tight"}, ["↑ find potential gismu conflicts?"]) ])); } - if (/[CV*?(|)]/.test(q)) { + if (/^[CV*?(|)a-pr-vx-z' ]+$/.test(q)) { try { _ = new RegExp( `^${h(q).replace(/C/g, "[bcdfgjklmnprstvxz]").replace(/V/g, "[aeiou]").replace(/\?/g, ".").replace(/\*+/g, ".*")}$`, "i" diff --git a/worker.js b/worker.js index e8f3fe4..0691dbe 100644 --- a/worker.js +++ b/worker.js @@ -55,7 +55,7 @@ function search(query) { results.push([entry, 1]); } } - } else if (/[CV*?(|)]/.test(original)) { + } else if (/^[CV*?(|)a-pr-vx-z' ]+$/.test(original)) { // also stolen from lynn of lidysisku etc fame var rgx; try {