Skip to content

Commit 7bb0612

Browse files
committed
Validate blacklist patterns
1 parent 05bcf21 commit 7bb0612

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

web/src/routes/diff/LoadDiffDialog.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
if (dirBlacklistInput === "") {
3636
return;
3737
}
38+
try {
39+
new RegExp(dirBlacklistInput); // Validate regex
40+
} catch (e) {
41+
alert("'" + dirBlacklistInput + "' is not a valid regex pattern. Error: " + e);
42+
return;
43+
}
3844
dirBlacklist.add(dirBlacklistInput);
3945
dirBlacklistInput = "";
4046
}

0 commit comments

Comments
 (0)