mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-22 16:33:48 +01:00
LSattr_html_select_list : Use inarray LSformRule instead of regex
This commit is contained in:
parent
4a646f2748
commit
73c9b385f8
1 changed files with 2 additions and 9 deletions
|
@ -64,15 +64,8 @@ class LSattr_html_select_list extends LSattr_html{
|
|||
}
|
||||
|
||||
// Mise en place de la regle de verification des donnees
|
||||
$regex_check_data='/';
|
||||
foreach ($possible_values as $val => $text) {
|
||||
if($regex_check_data=='/')
|
||||
$regex_check_data.='^'.preg_quote($val,'/').'$';
|
||||
else
|
||||
$regex_check_data.='|^'.preg_quote($val,'/').'$';
|
||||
}
|
||||
$regex_check_data.='/';
|
||||
$form -> addRule($this -> name, 'regex', array('msg'=> 'Valeur incorrect','params' => array('regex' => $regex_check_data)) );
|
||||
$form -> addRule($this -> name, 'inarray', array('msg'=> 'Valeur incorrect','params' => array('possible_values' => array_keys($possible_values))) );
|
||||
|
||||
// On retourne un pointeur vers l'element ajouter
|
||||
return $element;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue