Fix the insertion of multiple domains as wildcard (#3259)

This commit is contained in:
RD WebDesign
2025-03-02 04:05:24 -03:00
committed by GitHub

View File

@@ -496,15 +496,17 @@ function addDomain() {
return;
}
for (var i = 0; i < domains.length; i++) {
if (kind === "exact" && wildcardChecked) {
// Transform domain to wildcard if specified by user
domains[i] = "(\\.|^)" + domains[i].replaceAll(".", "\\.") + "$";
kind = "regex";
// strip leading "*." if specified by user in wildcard mode
// Check if the wildcard checkbox was marked and transform the domains into regex
if (kind === "exact" && wildcardChecked) {
for (var i = 0; i < domains.length; i++) {
// Strip leading "*." if specified by user in wildcard mode
if (domains[i].startsWith("*.")) domains[i] = domains[i].substr(2);
// Transform domain into a wildcard regex
domains[i] = "(\\.|^)" + domains[i].replaceAll(".", "\\.") + "$";
}
kind = "regex";
}
// determine list type