mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 00:29:38 +01:00
Change validation to accept & validate numeric list IDs if include_lists is set.
This commit is contained in:
parent
f82559b525
commit
470cf39e94
@ -112,9 +112,17 @@ class etemplate_widget_taglist extends etemplate_widget
|
||||
self::set_validation_error($form_name,lang("'%1' is NOT allowed ('%2')!",$val,implode("','",array_keys($allowed))),'');
|
||||
unset($value[$key]);
|
||||
}
|
||||
if($this->type == 'taglist-email' && !preg_match(etemplate_widget_url::EMAIL_PREG, $val))
|
||||
if($this->type == 'taglist-email' && $this->attrs['include_lists'] && is_numeric($val))
|
||||
{
|
||||
self::set_validation_error($form_name,lang("'%1' has an invalid format",$val),'');
|
||||
$lists = $GLOBALS['egw']->contacts->get_lists(EGW_ACL_READ);
|
||||
if(!array_key_exists($val, $lists))
|
||||
{
|
||||
self::set_validation_error($form_name,lang("'%1' is NOT allowed ('%2')!",$val,implode("','",array_keys($lists))),'');
|
||||
}
|
||||
}
|
||||
else if($this->type == 'taglist-email' && !preg_match(etemplate_widget_url::EMAIL_PREG, $val))
|
||||
{
|
||||
self::set_validation_error($form_name,lang("'%1' has an invalid format",$val),'');
|
||||
}
|
||||
}
|
||||
if ($ok && $value === '' && $this->attrs['needed'])
|
||||
|
Loading…
Reference in New Issue
Block a user