浏览代码

Improve email validation

Tjebbe Lievens 9 年之前
父节点
当前提交
aacaf1b08f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      func/main.sh

+ 1 - 1
func/main.sh

@@ -612,7 +612,7 @@ is_dns_record_format_valid() {
 
 # Email format validator
 is_email_format_valid() {
-    if [[ ! "$1" =~ "@" ]] ; then
+    if [[ ! "$1" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,63}$ ]] ; then
         check_result $E_INVALID "invalid email format :: $1"
     fi
 }