X-Git-Url: https://git.p6c8.net/form-email.git/blobdiff_plain/c11340f2adaf46b0294d96a9a18740dfcdbd1e24..5708186b376ec6b2c67d01a88d35f8cf34009aa0:/form-email/functions.php?ds=sidebyside diff --git a/form-email/functions.php b/form-email/functions.php index d9f3482..ad330eb 100644 --- a/form-email/functions.php +++ b/form-email/functions.php @@ -7,7 +7,7 @@ # geschrieben wurde. # # Autor: Patrick Canterino -# Letzte Aenderung: 17.12.2011 +# Letzte Aenderung: 03.03.2012 # # Copyright (C) 2002-2012 Patrick Canterino # @@ -144,17 +144,19 @@ function show_user_error($errmsg) { $tpl->set_var('SUBJECT',htmlspecialchars($subject)); $tpl->set_var('TEXT', htmlspecialchars($text)); - reset($user_fields); + if(isset($user_fields)) { + reset($user_fields); - while(list($user_field,$user_field_data) = each($user_fields)) { - if(isset($user_field_data['tpl_var']) && $user_field_data['tpl_var'] != '') { - $tpl_var = $user_field_data['tpl_var']; - } - else { - $tpl_var = 'USER_'.$user_field; - } + while(list($user_field,$user_field_data) = each($user_fields)) { + if(isset($user_field_data['tpl_var']) && $user_field_data['tpl_var'] != '') { + $tpl_var = $user_field_data['tpl_var']; + } + else { + $tpl_var = 'USER_'.$user_field; + } - $tpl->set_var($tpl_var,htmlspecialchars(formdata($user_field))); + $tpl->set_var($tpl_var,htmlspecialchars(formdata($user_field))); + } } $tpl->parse();