mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-01-11 22:44:44 +00:00
Don't validate regex domains
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
parent
cffb4de83b
commit
8435eeed4d
1 changed files with 7 additions and 3 deletions
|
@ -66,11 +66,15 @@ HandleOther() {
|
||||||
# Convert to lowercase
|
# Convert to lowercase
|
||||||
domain="${1,,}"
|
domain="${1,,}"
|
||||||
|
|
||||||
# Check validity of domain
|
# Check validity of domain (don't check for regex entries)
|
||||||
if [[ "${#domain}" -le 253 ]]; then
|
if [[ "${#domain}" -le 253 ]]; then
|
||||||
|
if [[ "${listMain}" == "${regexlist}" ]]; then
|
||||||
|
validDomain=""
|
||||||
|
else
|
||||||
validDomain=$(grep -P "^((-|_)*[a-z\d]((-|_)*[a-z\d])*(-|_)*)(\.(-|_)*([a-z\d]((-|_)*[a-z\d])*))*$" <<< "${domain}") # Valid chars check
|
validDomain=$(grep -P "^((-|_)*[a-z\d]((-|_)*[a-z\d])*(-|_)*)(\.(-|_)*([a-z\d]((-|_)*[a-z\d])*))*$" <<< "${domain}") # Valid chars check
|
||||||
validDomain=$(grep -P "^[^\.]{1,63}(\.[^\.]{1,63})*$" <<< "${validDomain}") # Length of each label
|
validDomain=$(grep -P "^[^\.]{1,63}(\.[^\.]{1,63})*$" <<< "${validDomain}") # Length of each label
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -n "${validDomain}" ]]; then
|
if [[ -n "${validDomain}" ]]; then
|
||||||
domList=("${domList[@]}" ${validDomain})
|
domList=("${domList[@]}" ${validDomain})
|
||||||
|
|
Loading…
Reference in a new issue