mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 12:48:29 +00:00
Fix the insertion of multiple domains as wildcard (#3259)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user