<commit_before><?php
session_start();
foreach ($_POST as $key => $value) {
    $_SESSION[$key] = $value;
}
$mandatoryFields = array('ADMIN_PASSWORD', 'confirm_password', 'firstname', 'lastname', 'email');
$strError = '';

$emailRegexp = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/';
if (!preg_match($emailRegexp, $_POST['email'])) {
    $strError .= 'jQuery("input[name=email]").next().html("Invalid E-mail");';
}

foreach ($mandatoryFields as $field) {
    if ($_POST[$field] == '') {
        $strError .= 'jQuery("input[name='.$field.']").next().html("Mandatory field");';
    }
}

if ($_POST['ADMIN_PASSWORD'] != $_POST['confirm_password']) {
    $strError .= 'jQuery("input[name=confirm_password]").next().html("Passwords do not match");';
}

if ($strError) {
    echo $strError;
} else {
    echo 0;
}<commit_msg>fixes #3883 Now we allow local domain in email validation<commit_after><?php
session_start();
foreach ($_POST as $key => $value) {
    $_SESSION[$key] = $value;
}
$mandatoryFields = array('ADMIN_PASSWORD', 'confirm_password', 'firstname', 'lastname', 'email');
$strError = '';

$emailRegexp = '/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z0-9-]+)*$/';
if (!preg_match($emailRegexp, $_POST['email'])) {
    $strError .= 'jQuery("input[name=email]").next().html("Invalid E-mail");';
}

foreach ($mandatoryFields as $field) {
    if ($_POST[$field] == '') {
        $strError .= 'jQuery("input[name='.$field.']").next().html("Mandatory field");';
    }
}

if ($_POST['ADMIN_PASSWORD'] != $_POST['confirm_password']) {
    $strError .= 'jQuery("input[name=confirm_password]").next().html("Passwords do not match");';
}

if ($strError) {
    echo $strError;
} else {
    echo 0;
}
{'fraction_non_alphanumeric': 0.26361529548088064, 'fraction_numerical': 0.013904982618771726, 'mean_word_length': 4.775919732441472, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4887245', 'n_tokens_mistral': 651, 'n_tokens_neox': 646, 'n_words': 105}