forked from extern/egroupware
Change validation to accept & validate numeric list IDs if include_lists is set.
This commit is contained in:
parent
f82559b525
commit
470cf39e94
@ -112,7 +112,15 @@ class etemplate_widget_taglist extends etemplate_widget
|
|||||||
self::set_validation_error($form_name,lang("'%1' is NOT allowed ('%2')!",$val,implode("','",array_keys($allowed))),'');
|
self::set_validation_error($form_name,lang("'%1' is NOT allowed ('%2')!",$val,implode("','",array_keys($allowed))),'');
|
||||||
unset($value[$key]);
|
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))
|
||||||
|
{
|
||||||
|
$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),'');
|
self::set_validation_error($form_name,lang("'%1' has an invalid format",$val),'');
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user