Skip to content

Commit ef74db8

Browse files
authored
Fix the insertion of multiple domains as wildcard (#3259)
2 parents 014b2e8 + f368453 commit ef74db8

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

scripts/js/groups-domains.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -496,15 +496,17 @@ function addDomain() {
496496
return;
497497
}
498498

499-
for (var i = 0; i < domains.length; i++) {
500-
if (kind === "exact" && wildcardChecked) {
501-
// Transform domain to wildcard if specified by user
502-
domains[i] = "(\\.|^)" + domains[i].replaceAll(".", "\\.") + "$";
503-
kind = "regex";
504-
505-
// strip leading "*." if specified by user in wildcard mode
499+
// Check if the wildcard checkbox was marked and transform the domains into regex
500+
if (kind === "exact" && wildcardChecked) {
501+
for (var i = 0; i < domains.length; i++) {
502+
// Strip leading "*." if specified by user in wildcard mode
506503
if (domains[i].startsWith("*.")) domains[i] = domains[i].substr(2);
504+
505+
// Transform domain into a wildcard regex
506+
domains[i] = "(\\.|^)" + domains[i].replaceAll(".", "\\.") + "$";
507507
}
508+
509+
kind = "regex";
508510
}
509511

510512
// determine list type

0 commit comments

Comments
 (0)