diff options
author | Adam Warner <me@adamwarner.co.uk> | 2020-04-05 14:28:33 +0300 |
---|---|---|
committer | Adam Warner <me@adamwarner.co.uk> | 2020-04-05 14:28:33 +0300 |
commit | a9b19df4ec2b99442704cf2b7656908e3e10bc14 (patch) | |
tree | d7bad95edaf410a45c3621a4552a231716003b11 | |
parent | 2de5362adc2c1c780eac1ab39e466875143091d5 (diff) |
expand email validation regex to catch more valid emails see comments on PR #3254
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
-rwxr-xr-x | advanced/Scripts/webpage.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/advanced/Scripts/webpage.sh b/advanced/Scripts/webpage.sh index f0f8bc31..b60428f6 100755 --- a/advanced/Scripts/webpage.sh +++ b/advanced/Scripts/webpage.sh @@ -519,7 +519,9 @@ Options: 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 + 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])?\$" + if [[ ! "${args[2]}" =~ ${regex} ]]; then echo -e " ${CROSS} Invalid email address" exit 0 fi |