forked from extern/egroupware
Do not try to validate empty strings as email. If it's required but empty, give the required validation message.
This commit is contained in:
parent
4311eebdc9
commit
46389e72f7
@ -189,7 +189,7 @@ class Taglist extends Etemplate\Widget
|
|||||||
}
|
}
|
||||||
else
|
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)) &&
|
!($this->attrs['domainOptional'] && preg_match(Taglist::EMAIL_PREG_NO_DOMAIN, $val)) &&
|
||||||
// Allow merge placeholders. Might be a better way to do this though.
|
// Allow merge placeholders. Might be a better way to do this though.
|
||||||
!preg_match('/{{.+}}|\$\$.+\$\$/', $val)
|
!preg_match('/{{.+}}|\$\$.+\$\$/', $val)
|
||||||
|
Loading…
Reference in New Issue
Block a user