<commit_before><?php

/**
 * @return void
 */
function registration()
{
    if (isLoggedIn()) {
        echo router('/');
        return;
    }
    $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);
    $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);
    $email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_STRING);
    $email = filter_var($email, FILTER_VALIDATE_EMAIL);
	if(isPost()){
		$errors = doRegister($username, $password, $email);
	}
    

    $data = [
        'username' => $username,
        'password' => <PASSWORD>,
        'email' => $email,
        'errors' => $errors
    ];

    navigation(_('login'), '/');
    activateNavigation('/');

    echo render('registration', $data);
}

/**<commit_msg>fixed error message<commit_after><?php

/**
 * @return void
 */
function registration()
{
    if (isLoggedIn()) {
        echo router('/');
        return;
    }
    $username = filter_input(INPUT_POST, 'username', FILTER_SANITIZE_STRING);
    $password = filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);
    $email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_STRING);
    $email = filter_var($email, FILTER_VALIDATE_EMAIL);
    $errors = [];
	if(isPost()){
		$errors = doRegister($username, $password, $email);
	}
    

    $data = [
        'username' => $username,
        'password' => <PASSWORD>,
        'email' => $email,
        'errors' => $errors
    ];

    navigation(_('login'), '/');
    navigation(_('create account'), '/register');
    activateNavigation('/register');

    echo render('registration', $data);
}

/**
{'fraction_non_alphanumeric': 0.17610837438423646, 'fraction_numerical': 0.0, 'mean_word_length': 3.3218085106382977, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 13, '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': '940357', 'n_tokens_mistral': 545, 'n_tokens_neox': 522, 'n_words': 94}