<commit_before><form action="" method="post">
<?php
	include('config.php');
	include('../preheader.php');
    require_once('../lib/recaptchalib.php');

	// Get a key from https://www.google.com/recaptcha/admin/create
	$publickey = "<KEY>";
	$privatekey = "<KEY>";

	# the response from reCAPTCHA
	$resp = null;

	# the error code from reCAPTCHA, if any
	$error = null;

	# was there a reCAPTCHA response?
	if ($_POST["recaptcha_response_field"]) {
        $resp = recaptcha_check_answer ($privatekey,
        $_SERVER["REMOTE_ADDR"],
        $_POST["recaptcha_challenge_field"],
        $_POST["recaptcha_response_field"]);

        if ($resp->is_valid) {
              if (!isset($_POST['Login'])) {
                $cerr=2;
              } 
              if (!ctype_alnum($_POST['Login'])) {
                $cerr=2;
              } 
              if (!isset($_POST['Email'])) {
                $cerr=2;
              }
              if (!isset($_POST['Password'])) {
                $cerr=2;
              }
            $login=mysql_real_escape_string($_POST['Login']);
              $email=mysql_real_escape_string($_POST['Email']);
              $forename=mysql_real_escape_string($_POST['Forename']);
              $name=mysql_real_escape_string($_POST['Name']);
              $password=crypt(mysql_real_escape_string($_POST['Password']), <PASSWORD>$');
              $location=mysql_real_escape_string($_POST['Location']);
              $sql="SELECT uid FROM cs_users WHERE ulogin='".$login."'; ";
              $result=mysql_query($sql);
              $row=mysql_fetch_array($result);
              $count=mysql_num_rows($result);
               if (($count == 0) && ($cerr == 0)) { 
                echo "<div class=\"white-box\"><h2>You got it! Click <a href=\"../index.php\">here</a></h2>";
                echo "Yes. We hate CAPTCHAs too.</div>";
                $sql="INSERT INTO cs_users VALUES ('', '".$login."', '".$email."', '".$forename."', '".$name."', '".$password."', NOW(), '".$location."', 'yes'); ";
                $result = mysql_query($sql); 
              } 
              
              else {
                echo("<div class=\"white-box\">Error: Sorry. Username already taken, invalid or you forgot something in General section.</div>");
              }
        } 
        
        else {
        	# set the error code so that we can display it
            $error = $resp->error;
        }
    }
?>
        <div class="white-box"><commit_msg>xss prevention in register<commit_after><form action="" method="post">
<?php
	include('config.php');
	include('../preheader.php');
    require_once('../lib/recaptchalib.php');
    include('../lib/antixss.php');

	// Get a key from https://www.google.com/recaptcha/admin/create
	$publickey = "<KEY>";
	$privatekey = "<KEY>";

	# the response from reCAPTCHA
	$resp = null;

	# the error code from reCAPTCHA, if any
	$error = null;

	# was there a reCAPTCHA response?
	if ($_POST["recaptcha_response_field"]) {
        $resp = recaptcha_check_answer ($privatekey,
        $_SERVER["REMOTE_ADDR"],
        $_POST["recaptcha_challenge_field"],
        $_POST["recaptcha_response_field"]);

        if ($resp->is_valid) {
              if (!isset($_POST['Login'])) {
                $cerr=2;
              } 
              if (!ctype_alnum($_POST['Login'])) {
                $cerr=2;
              } 
              if (!isset($_POST['Email'])) {
                $cerr=2;
              }
              if (!isset($_POST['Password'])) {
                $cerr=2;
              }
              $login=AntiXSS::setFilter(mysql_real_escape_string($_POST['Login']), "whitelist", "string");
              $email=AntiXSS::setFilter(mysql_real_escape_string($_POST['Email']), "whitelist", "string");
              $password=crypt(mysql_real_escape_string($_POST['Password']), <PASSWORD>$');
              $forename=AntiXSS::setFilter(mysql_real_escape_string($_POST['Forename']), "whitelist", "string");
              $name=AntiXSS::setFilter(mysql_real_escape_string($_POST['Name']), "whitelist", "string");
              $location=AntiXSS::setFilter(mysql_real_escape_string($_POST['Location']), "whitelist", "string");
              $sql="SELECT uid FROM cs_users WHERE ulogin='".$login."'; ";
              $result=mysql_query($sql);
              $row=mysql_fetch_array($result);
              $count=mysql_num_rows($result);
               if (($count == 0) && ($cerr == 0)) { 
                echo "<div class=\"white-box\"><h2>You got it! Click <a href=\"../index.php\">here</a></h2>";
                echo "Yes. We hate CAPTCHAs too.</div>";
                $sql="INSERT INTO cs_users VALUES ('', '".$login."', '".$email."', '".$forename."', '".$name."', '".$password."', NOW(), '".$location."', 'yes'); ";
                $result = mysql_query($sql); 
              } 
              
              else {
                echo("<div class=\"white-box\">Error: Sorry. Username already taken, invalid or you forgot something in General section.</div>");
              }
        } 
        
        else {
        	# set the error code so that we can display it
            $error = $resp->error;
        }
    }
?>
        <div class="white-box">
{'fraction_non_alphanumeric': 0.17885242755709077, 'fraction_numerical': 0.003070427940894262, 'mean_word_length': 2.1023809523809525, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 35, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1600645', 'n_tokens_mistral': 1604, 'n_tokens_neox': 1528, 'n_words': 287}