mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-11 00:18:25 +01:00
Adopt taglist server side accordingly regarding domainOptional attribute
This commit is contained in:
parent
f230917d21
commit
7b810b57f3
@ -24,6 +24,14 @@ use mail_compose;
|
|||||||
*/
|
*/
|
||||||
class Taglist extends Etemplate\Widget
|
class Taglist extends Etemplate\Widget
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Regexp for validating email alias considering domain part be optional
|
||||||
|
* this should be used regarding the domainOptional attribute defined in
|
||||||
|
* taglist-email.
|
||||||
|
*/
|
||||||
|
const EMAIL_PREG_NO_DOMAIN = "/^(([^\042',<][^,<]+|\042[^\042]+\042|\'[^\']+\'|)\s?<)?[^\x01-\x20()<>@,;:\042\[\]]+(@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,})?>?$/iu";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*
|
*
|
||||||
@ -131,6 +139,7 @@ class Taglist extends Etemplate\Widget
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if($this->type == 'taglist-email' && !preg_match(Url::EMAIL_PREG, $val) &&
|
else if($this->type == 'taglist-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.
|
// 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