mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
add regex attribution
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
a9b19df4ec
commit
b6ac1585ec
@ -519,6 +519,7 @@ Options:
|
|||||||
if [[ -n "${args[2]}" ]]; then
|
if [[ -n "${args[2]}" ]]; then
|
||||||
|
|
||||||
# Sanitize email address in case of security issues
|
# Sanitize email address in case of security issues
|
||||||
|
# Regex from https://stackoverflow.com/a/2138832/4065967
|
||||||
local regex
|
local regex
|
||||||
regex="^[a-z0-9!#\$%&'*+/=?^_\`{|}~-]+(\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?\$"
|
regex="^[a-z0-9!#\$%&'*+/=?^_\`{|}~-]+(\.[a-z0-9!#$%&'*+/=?^_\`{|}~-]+)*@([a-z0-9]([a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]([a-z0-9-]*[a-z0-9])?\$"
|
||||||
if [[ ! "${args[2]}" =~ ${regex} ]]; then
|
if [[ ! "${args[2]}" =~ ${regex} ]]; then
|
||||||
|
Loading…
Reference in New Issue
Block a user