mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Sanitize email address in case of security issues (#3254)
* Sanitize email address in case of security issues Signed-off-by: bash-c <aboultraman@gmail.com>
This commit is contained in:
parent
a2d2639ee8
commit
2de5362adc
1 changed files with 7 additions and 0 deletions
|
@ -517,6 +517,13 @@ Options:
|
|||
fi
|
||||
|
||||
if [[ -n "${args[2]}" ]]; then
|
||||
|
||||
# Sanitize email address in case of security issues
|
||||
if [[ ! "${args[2]}" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$ ]]; then
|
||||
echo -e " ${CROSS} Invalid email address"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
change_setting "ADMIN_EMAIL" "${args[2]}"
|
||||
echo -e " ${TICK} Setting admin contact to ${args[2]}"
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue