' . oc_('Fields not correctly filled out') . '';
}
if (!isset($_POST['name']) || !preg_match("/\w/", $_POST['name']) || preg_match("/[\r\n]/", $_POST['name'])) {
$err .= '
' . oc_('Name field empty or invalid') . '';
}
if (!isset($_POST['liame']) || !validEmail(($_POST['liame'] = trim($_POST['liame']))) || preg_match("/[\r\n]/", $_POST['liame'])) {
$err .= '' . oc_('Email field empty or invalid') . '';
}
if (!isset($_POST['subject']) || !preg_match("/\w/", $_POST['subject']) || preg_match("/[\r\n]/", $_POST['subject'])) {
$err .= '' . oc_('Subject field empty or invalid') . '';
}
if (!isset($_POST['message']) || !preg_match("/\w/", $_POST['message'])) {
$err .= '' . oc_('Message field empty or invalid') . '';
}
if (oc_hookSet('author-contact-validate')) {
foreach ($GLOBALS['OC_hooksAR']['author-contact-validate'] as $hook) {
require_once $hook;
}
}
if (empty($err)) {
$hdr = 'From: "' . $_POST['name'] . '" <' . $_POST['liame'] . ">\r\nReply-To: " . $_POST['liame'];
if (! oc_mail($OC_configAR['OC_pcemail'], $_POST['subject'], $_POST['message'], $hdr)) {
err(oc_('An error occurred sending out the email.'));
} else {
print '' . oc_('Your message has been sent.') . '
';
printFooter();
exit;
}
}
}
print '
';
printFooter();
?>