<?php

/**
 *
 * @copyright  2021-2022 mcpalo.com
 * @version    2
 * @link       http://www.mcpalo.com
 */

require_once 'sendhttp.php';
require_once 'filemimetype.php';

function antivirus($login, $password, $file) {
	$curl = 'https://tesseractor.com/api/v1/antivirus' . '?' . 'login=' . urlencode($login) . '&' . 'password=' . urlencode($password);

	$files=array('file' => array('name' => basename($file), 'tmp_name' => $file, 'type' => file_mime_type($file)));

	$response=sendpost($curl, false, $files);

	if (!$response or $response[0] != 200) {
		return false;
	}

	$r=json_decode($response[2], true);

	if ($r['status'] == 'success') {
		return true;
	}

	if ($r['status'] == 'fail') {
		return $r['data']['names'];
	}

	return false;
}
