Exemplo n.º 1
0
function check_data($host, $author, $subject, $body, $email)
{
    global $lNoAuthor, $lNoSubject, $lNoBody, $lNoEmail, $lRegisteredName;
    global $Password, $ModPass, $email_reply;
    $IsError = '';
    if (!check_host($host)) {
        violation();
    }
    $author = @trim($author);
    if (empty($author)) {
        $IsError = $lNoAuthor;
    } elseif (!check_name($author)) {
        violation();
    } elseif (!check_register($author)) {
        $IsError = $lRegisteredName;
    }
    if (trim($subject) == "") {
        $IsError = $lNoSubject;
    }
    if (trim($body) == "") {
        $IsError = $lNoBody;
    }
    if (!empty($email)) {
        if (!eregi(".+@.+\\..+", $email) && $email != $Password && $email != $ModPass) {
            if ($email_reply) {
                $IsError = $lNoEmail;
            }
        } else {
            if (!check_email($email)) {
                violation();
            }
        }
    } elseif ($email_reply) {
        $IsError = $lNoEmail;
    }
    return $IsError;
}
Exemplo n.º 2
0
$toaddress = empty($eHeaders["to"]) ? '' : $eHeaders["to"];
$msgid = empty($eHeaders["message-id"]) ? '' : $eHeaders["message-id"];
// The email this is a reply to should be in In-Reply-To, but some
// mailers seem to use References instead.
// Both fields can have multiple message ids in them, so just grab the first.
$inreplyto = '';
if (@ereg('^(<[^>]+>)', $eHeaders["in-reply-to"], $regs)) {
    $inreplyto = $regs[1];
} else {
    if (@ereg('^(<[^>]+>)', $eHeaders["references"], $regs)) {
        $inreplyto = $regs[1];
    }
}
$IsError = check_data($host, $author, $subject, $body, $email);
if (!empty($IsError)) {
    violation();
}
$author = trim($author);
$subject = trim($subject);
$email = trim($email);
$body = chop($body);
list($author, $subject, $email, $body) = censor($author, $subject, $email, $body);
$author = addslashes($author);
$email = addslashes($email);
$subject = addslashes($subject);
$body = addslashes($body);
$plain_author = stripslashes($author);
$plain_subject = stripslashes(ereg_replace("<[^>]+>", "", $subject));
$plain_body = stripslashes(ereg_replace("<[^>]+>", "", $body));
$author = htmlspecialchars($author);
$email = htmlspecialchars($email);