]> git.p6c8.net - form-email.git/blobdiff - form-email/mailer.php
Pruefung ob indiv. Feld gesetzt wurde, funktioniert.
[form-email.git] / form-email / mailer.php
index b32f095ca6efd6f911c8ab76183e19ee2e751ff7..52e3110305c00e306a8f7c0477926dfcad14bbb1 100644 (file)
@@ -96,6 +96,14 @@ $prepared_user_fields = array();
 \r
 while(list($user_field,$user_field_data) = each($user_fields)) {\r
     $user_field_content = formdata($user_field);\r
+    \r
+    if((!$user_field_data['optional']) && (!$user_field_content)) {\r
+        show_user_error($user_field_data['errors']['not_set']);\r
+    }\r
+    elseif($user_field_data['optional'] && (!$user_field_content)) {\r
+        $prepared_user_fields[$user_field_data['tpl_var']] = '';\r
+        continue;\r
+    }\r
 \r
     if(isset($user_field_data['check']) && $user_field_data['check'] != '') {\r
         if(function_exists($user_field_data['check']) && call_user_func($user_field_data['check'],$user_field_content) === false) {\r

patrick-canterino.de