mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Remove guard on whitspace
We can just trim instead
This commit is contained in:
parent
a2a8b6449f
commit
f3e41861d2
@ -126,12 +126,12 @@
|
||||
// Return/Enter key press otherwise bail
|
||||
if (e.keyCode !== 13) return;
|
||||
|
||||
let word = document.getElementById("searchbox").value
|
||||
let word = document.getElementById("searchbox").value;
|
||||
document.getElementById("searchbox").value = "";
|
||||
|
||||
word = word.toLowerCase();
|
||||
word = word.replace(/[`'"]/gi, " ")
|
||||
safe_word = sanitize(word)
|
||||
word = word.replace(/[`'"]/gi, " ");
|
||||
|
||||
let safe_word = sanitize(word).trimLeft();
|
||||
|
||||
if (word.includes("\\n")) {
|
||||
window.alert("Nice try...");
|
||||
@ -143,11 +143,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (safe_word.startsWith(" ")) {
|
||||
window.alert("Illegal first character");
|
||||
return;
|
||||
}
|
||||
|
||||
// Display filtered word
|
||||
words.push(word);
|
||||
$("#ignored-words").append(
|
||||
|
Loading…
Reference in New Issue
Block a user