<commit_before><?php

	$json = array();

	if (!empty($_FILES['file']['name'])) 
	{
		$filename = basename(preg_replace('/[^a-zA-Z0-9\.\-\s+]/', '', html_entity_decode($_FILES['file']['name'], ENT_QUOTES, 'UTF-8')));

		// Allowed file extension types
		$allowed = array('JPG','jpe','png', 'jpg','gif');

		if (!in_array(substr(strrchr($filename, '.'), 1), $allowed)) 
		{
			$json['error'] = 'File type is not allowed';
		}
		
	} 
	else 
	{
		$json['error'] = 'Upload error';
	}
	

	if (!$json && is_uploaded_file($_FILES['file']['tmp_name']) && file_exists($_FILES['file']['tmp_name'])) 
	{
		$dir = '../../../wp-content/uploads/photo/';
		
		$file = $dir . $filename;		
		
		move_uploaded_file($_FILES['file']['tmp_name'], $file);

		$json['success'] = 'Upload success';
	}
	
	//print_r($json);

	echo json_encode($json);
		
?><commit_msg>test upload<commit_after><?php

	echo "hello";

	/*$json = array();

	if (!empty($_FILES['file']['name'])) 
	{
		$filename = basename(preg_replace('/[^a-zA-Z0-9\.\-\s+]/', '', html_entity_decode($_FILES['file']['name'], ENT_QUOTES, 'UTF-8')));

		// Allowed file extension types
		$allowed = array('JPG','jpe','png', 'jpg','gif');

		if (!in_array(substr(strrchr($filename, '.'), 1), $allowed)) 
		{
			$json['error'] = 'File type is not allowed';
		}
		
	} 
	else 
	{
		$json['error'] = 'Upload error';
	}
	

	if (!$json && is_uploaded_file($_FILES['file']['tmp_name']) && file_exists($_FILES['file']['tmp_name'])) 
	{
		$dir = '../../../wp-content/uploads/photo/';
		
		$file = $dir . $filename;		
		
		move_uploaded_file($_FILES['file']['tmp_name'], $file);

		$json['success'] = 'Upload success';
	}
	
	//print_r($json);

	echo json_encode($json);*/
		
?>
{'fraction_non_alphanumeric': 0.26294117647058823, 'fraction_numerical': 0.004705882352941176, 'mean_word_length': 3.973684210526316, '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': '6883538', 'n_tokens_mistral': 719, 'n_tokens_neox': 627, 'n_words': 99}