<commit_before><?php
defined('BASEPATH') OR exit('No direct script access allowed');

//use Restserver\Libraries\REST_Controller;

require APPPATH . '/libraries/REST_Controller.php';

// use namespace
use Restserver\Libraries\REST_Controller;

class Api extends REST_Controller
{
	public function verifyemail_get()
	{
			
		$email = $this->get('email');
		$fromEmail = $this->get('fromEmail');
		$port = !empty($this->get('port')) ? $this->get('port') : 25;
		$debug= $this->get('debug');
		$combinations = array();
		$combinationAllowedCount= 10;
		//$combinations = $this->get('combinations');
		if(is_array($this->get('combinations')))
		{
			$combinations = $this->get('combinations');
		}

		//print_r(count($combinations));
		//exit();

		$requiredFileds= '';
		if(empty($email)){
			$requiredFileds .= ', email';
		}
		
		if(empty($fromEmail)){
			$requiredFileds .= ', fromEmail';
		}

		if(trim($requiredFileds) != ''){
			
			$message = array('error' => 'required fields not provided:'. trim($requiredFileds, ","));

			$this->response($message);
			return ;

		}

		if(count($combinations) > 10){
			$message = array('error' => 'Email combinations exceeds the allowed size');
			$this->response($message);
			return ;			
		}



		$params = array('email' => $this->get('email'), 'fromEmail' => $fromEmail, 'port' => 25, 'combinations' => $combinations);



		$this->load->library('ValidateEmail', $params);

		if(count($combinations) <= 10){
			$data = $this->validateemail->validateCombinations($combinations, $debug);
		
		}else{
			
			$data = $this->validateemail->checkEmail($debug);
		}

		$this->response($data);

  	}

	public function index_post()
	{<commit_msg>changed email combination limit from 10 to 5<commit_after><?php
defined('BASEPATH') OR exit('No direct script access allowed');

//use Restserver\Libraries\REST_Controller;

require APPPATH . '/libraries/REST_Controller.php';

// use namespace
use Restserver\Libraries\REST_Controller;

class Api extends REST_Controller
{
	public function verifyemail_get()
	{
			
		$email = $this->get('email');
		$fromEmail = $this->get('fromEmail');
		$port = !empty($this->get('port')) ? $this->get('port') : 25;
		$debug= $this->get('debug');
		$combinations = array();
		$combinationAllowedCount= 10;
		//$combinations = $this->get('combinations');
		if(is_array($this->get('combinations')))
		{
			$combinations = $this->get('combinations');
		}

		//print_r(count($combinations));
		//exit();

		$requiredFileds= '';
		if(empty($email)){
			$requiredFileds .= ', email';
		}
		
		if(empty($fromEmail)){
			$requiredFileds .= ', fromEmail';
		}

		if(trim($requiredFileds) != ''){
			
			$message = array('error' => 'required fields not provided:'. trim($requiredFileds, ","));

			$this->response($message);
			return ;

		}

		if(count($combinations) > 5){
			$message = array('error' => 'Email combinations exceeds the allowed size');
			$this->response($message);
			return ;			
		}



		$params = array('email' => $this->get('email'), 'fromEmail' => $fromEmail, 'port' => 25, 'combinations' => $combinations);



		$this->load->library('ValidateEmail', $params);

		if(count($combinations) <= 5 && count($combinations) > 0){
			$data = $this->validateemail->validateCombinations($combinations, $debug);
		
		}else{
			
			$data = $this->validateemail->checkEmail($debug);
		}

		$this->response($data);

  	}

	public function index_post()
	{
{'fraction_non_alphanumeric': 0.19654869844983913, 'fraction_numerical': 0.006434630008774495, 'mean_word_length': 4.34375, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 54, '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': '1661687', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1111, 'n_words': 203}