From 46389e72f781a653a0d86a8f14d8145f965ef28d Mon Sep 17 00:00:00 2001 From: nathan Date: Wed, 22 Feb 2023 15:17:17 -0700 Subject: [PATCH] Do not try to validate empty strings as email. If it's required but empty, give the required validation message. --- api/src/Etemplate/Widget/Taglist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/Etemplate/Widget/Taglist.php b/api/src/Etemplate/Widget/Taglist.php index abef17b0a6..596de5454f 100644 --- a/api/src/Etemplate/Widget/Taglist.php +++ b/api/src/Etemplate/Widget/Taglist.php @@ -189,7 +189,7 @@ class Taglist extends Etemplate\Widget } else { - if(str_contains($this->type, 'email') && !preg_match(Url::EMAIL_PREG, $val) && + if($val !== '' && str_contains($this->type, 'email') && !preg_match(Url::EMAIL_PREG, $val) && !($this->attrs['domainOptional'] && preg_match(Taglist::EMAIL_PREG_NO_DOMAIN, $val)) && // Allow merge placeholders. Might be a better way to do this though. !preg_match('/{{.+}}|\$\$.+\$\$/', $val)