<commit_before><?php
/**
 * require all composer dependencies; requiring the autoload file loads all composer packages at once
 * while this is convenient, this may load too much if your composer configuration grows to many classes
 * if this is a concern, load "/vendor/swiftmailer/autoload.php" instead to load just SwiftMailer
 **/
require_once(dirname(dirname(dirname(dirname(__DIR__)))) . "/vendor/autoload.php");

//Input Sanitization
$name = $_POST["name"];
$name = filter_var($name, FILTER_SANITIZE_STRING);

$email = $_POST["email"];
$email = filter_var($email, FILTER_SANITIZE_STRING);
$email = filter_var($email, FILTER_VALIDATE_EMAIL);
if($email === false) {
	throw(new RuntimeException("Email address is invalid"));
}

$phone = $_POST["phone"];
$phone = filter_var($phone, FILTER_SANITIZE_STRING);

$website = $_POST["website"];
$website = filter_var($website, FILTER_SANITIZE_STRING);
<commit_msg>Added input sanitization for "product".<commit_after><?php
/**
 * require all composer dependencies; requiring the autoload file loads all composer packages at once
 * while this is convenient, this may load too much if your composer configuration grows to many classes
 * if this is a concern, load "/vendor/swiftmailer/autoload.php" instead to load just SwiftMailer
 **/
require_once(dirname(dirname(dirname(dirname(__DIR__)))) . "/vendor/autoload.php");

//Input Sanitization
$product = $_POST["product"];
$product = filter_var($product, FILTER_SANITIZE_STRING);

$name = $_POST["name"];
$name = filter_var($name, FILTER_SANITIZE_STRING);

$email = $_POST["email"];
$email = filter_var($email, FILTER_SANITIZE_STRING);
$email = filter_var($email, FILTER_VALIDATE_EMAIL);
if($email === false) {
	throw(new RuntimeException("Email address is invalid"));
}

$phone = $_POST["phone"];
$phone = filter_var($phone, FILTER_SANITIZE_STRING);

$website = $_POST["website"];
$website = filter_var($website, FILTER_SANITIZE_STRING);

{'fraction_non_alphanumeric': 0.13739669421487602, 'fraction_numerical': 0.0, 'mean_word_length': 6.810483870967742, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4365474', 'n_tokens_mistral': 625, 'n_tokens_neox': 593, 'n_words': 165}