' . "\n";
// optional text after mailform (hhidden page/newsbox)
$o.= newsbox('CMSimpleMFC1') . "\n";
$title = $tx['title'][$f];
$o .= '
' . $title . '
' . "\n";
// optional text after mailform (hhidden page/newsbox)
$o.= newsbox('CMSimpleMFC2') . "\n";
initvar('sendername');
initvar('senderphone');
initvar('sender');
initvar('getlast');
initvar('cap');
initvar('mailform');
function check_for_linebreaks($field)
{
if(preg_match("/%0A|\\r|%0D|\\n|%00|\\0|%09|\\t|%01|%02|%03|%04|%05|%06|%07|%08|%09|%0B|%0C|%0E|%0F|%10|%11|%12|%13/i", $field))
{
return true;
}
else
{
return false;
}
}
$t = '';
if ($action == 'send')
{
$msg = ($tx['mailform']['sendername'] . ": " . stsl($sendername) . " - " . stsl($sender) . "\n" . $tx['mailform']['senderphone'] . ": " . stsl($senderphone) . "\n\n" . stsl($mailform));
$CMSimpleMailformSubject = $tx['menu']['mailform'] . ' ' . sv('SERVER_NAME');
// MAIL DELIVERY and MESSAGES
if ($getlast != $cap && trim($cf['mailform']['captcha']) == 'true')
{
$e .= '' . $tx['mailform']['captchafalse'] . '';
}
if ($mailform == '')
{
$e .= '' . $tx['mailform']['mustwritemessage'] . '';
}
if (!(preg_match('!^[^@]+@[^@|^\s]+$!', $sender)))
{
$e .= '' . $tx['mailform']['notaccepted'] . '';
}
if (check_for_linebreaks($sendername) == true || check_for_linebreaks($senderphone) == true || check_for_linebreaks($sender) == true || check_for_linebreaks($getlast) == true || check_for_linebreaks($cap) == true || check_for_linebreaks($CMSimpleMailformSubject) == true || check_for_linebreaks($cf['mailform']['email']) == true)
{
die('No attacks please ... go back with the back button of your browser
');
}
if (!$e && !(mail($cf['mailform']['email'], '=?UTF-8?B?' . base64_encode($CMSimpleMailformSubject) . '?=', $msg, "From: CMSimple Mailform <" . $cf['mailform']['email'] . ">\r\n" . "Reply-To: " . stsl($sender) . "\r\n" . 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n")))
{
$e .= '' . $tx['mailform']['notsend'] . '' . "\n";
}
else
{
$t = '' . $tx['mailform']['send'] . '
' . "\n";
}
}
if(isset($_REQUEST['cmsimplemailformsent']))
{
$o.= '
' . $tx['mailform']['send'] . '
' . $tx['title']['mailform'] . ' »
' . "\n";
}
// MAILFORM
if (($t == '' || $e != '') && !isset($_REQUEST['cmsimplemailformsent']))
{
// JB+ add captcha
srand((double)microtime()*1000000);
$random=rand(10000,99999);
$o .= '' . "\n";
}
else
{
if(!isset($_REQUEST['cmsimplemailformsent']))header('Location: ./?&mailform&cmsimplemailformsent');
}
// optional text after mailform (hhidden page/newsbox)
$o.= '
' . "\n";
$o.= newsbox('CMSimpleMFC3') . "\n";
?>