@@ -541,7 +541,7 @@ function getHTML($record, $tab, $action = 'NEW') {
541541 foreach ($ field ['value ' ] as $ k => $ v ) {
542542 $ checked = ($ k == $ val )?' CHECKED ' :'' ;
543543 //$out .= "<label for=\"".$key."[]\" class=\"inlineLabel\"><input name=\"".$key."[]\" id=\"".$key."[]\" value=\"$k\" type=\"radio\" $checked/> $v</label>\r\n";
544- $ out .= "<label for= \"" .$ key .$ elementNo ."\" class= \"inlineLabel \"><input name= \"" .$ key ."[] \" id= \"" .$ key .$ elementNo ."\" value= \"$ k \" type= \"radio \" $ checked/> $ v </label> \r\n" ;
544+ $ out .= "<label for= \"" .$ key .$ elementNo ."\" class= \"inlineLabel \"><input name= \"" .$ key ."[] \" id= \"" .$ key .$ elementNo ."\" value= \"$ k \" type= \"radio \" $ checked/> " . $ this -> wordbook [ $ v ]. " </label> \r\n" ;
545545 $ elementNo ++;
546546 }
547547 }
@@ -671,7 +671,7 @@ function getHTML($record, $tab, $action = 'NEW') {
671671 foreach ($ field ['value ' ] as $ k => $ v ) {
672672 $ checked = ($ k == $ field ["default " ])?' CHECKED ' :'' ;
673673 //$out .= "<label for=\"".$key."[]\" class=\"inlineLabel\"><input name=\"".$key."[]\" id=\"".$key."[]\" value=\"$k\" type=\"radio\" $checked/> $v</label>\r\n";
674- $ out .= "<label for= \"" .$ key .$ elementNo ."\" class= \"inlineLabel \"><input name= \"" .$ key ."[] \" id= \"" .$ key .$ elementNo ."\" value= \"$ k \" type= \"radio \" $ checked/> $ v </label> \r\n" ;
674+ $ out .= "<label for= \"" .$ key .$ elementNo ."\" class= \"inlineLabel \"><input name= \"" .$ key ."[] \" id= \"" .$ key .$ elementNo ."\" value= \"$ k \" type= \"radio \" $ checked/> " . $ this -> wordbook [ $ v ]. " </label> \r\n" ;
675675 $ elementNo ++;
676676 }
677677 }
@@ -1022,13 +1022,22 @@ function validateField($field_name, $field_value, $validators) {
10221022 //* Do nothing
10231023 } else {
10241024 if (function_exists ('filter_var ' )) {
1025- if (filter_var ($ field_value , FILTER_VALIDATE_EMAIL ) === false ) {
1026- $ error = true ;
1027- } else {
1028- if (!preg_match ("/^[^ \\+]+$/ " , $ field_value )) { // * disallow + in local-part
1025+
1026+ //* When the field may contain several email addresses, split them by the char defined as separator
1027+ if (isset ($ validator ['separator ' ]) && $ validator ['separator ' ] != '' )
1028+ $ field_value_array = explode ($ validator ['separator ' ], $ field_value );
1029+ else $ field_value_array [] = $ field_value ;
1030+
1031+ foreach ($ field_value_array AS $ field_value ) {
1032+ //* FIXME: Maybe it it's no good to alter the field value, but with multiline field we get adresses with carriege-return at the end
1033+ $ field_value = trim ($ field_value );
1034+ if (filter_var ($ field_value , FILTER_VALIDATE_EMAIL ) === false ) {
1035+ $ error = true ;
1036+ } elseif (!preg_match ("/^[^ \\+]+$/ " , $ field_value )) { // * disallow + in local-part
10291037 $ error = true ;
10301038 }
10311039 }
1040+
10321041 if ($ error ) {
10331042 $ errmsg = $ validator ['errmsg ' ];
10341043 if (isset ($ this ->wordbook [$ errmsg ])) {
0 commit comments