<commit_before><?php
include_once("config.php");
define("DIR_ROOT", __DIR__);
define("DS", DIRECTORY_SEPARATOR);
include_once('sys/Parsedown.php');
include_once('sys/class.phpmailer.php');
require 'library/HTMLPurifier.auto.php';
date_default_timezone_set('Europe/Moscow');
$dbConnection = new PDO(
    'mysql:host='.$CONF_DB['host'].';dbname='.$CONF_DB['db_name'],
    $CONF_DB['username'],
    $CONF_DB['password'],
    array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
);
$dbConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$CONF = array (
'title_header'	=> get_conf_param('title_header'),
'hostname'	=> get_conf_param('hostname'),
'mail'	=> get_conf_param('mail'),
'name_of_firm'	=> get_conf_param('name_of_firm'),
'fix_subj'	=> get_conf_param('fix_subj'),
'first_login'	=> get_conf_param('first_login'),
'file_types' => get_conf_param('file_types'),
'file_types_img' => get_conf_param('file_types'),
'file_size' => get_conf_param('file_size'),
'permit_users_knt' => get_conf_param('permit_users_knt'),
'permit_users_req' => get_conf_param('permit_users_req'),
'permit_users_cont' => get_conf_param('permit_users_cont'),
'permit_users_documents' => get_conf_param('permit_users_documents'),
'permit_users_news' => get_conf_param('permit_users_news'),
'permit_users_license' => get_conf_param('permit_users_license'),
'default_org' => get_conf_param('default_org'),
'what_cartridge' => get_conf_param('what_cartridge'),
'what_print_test' => get_conf_param('what_print_test'),
'what_license' => get_conf_param('what_license'),
'home_text' => get_conf_param('home_text')
);

$CONF_MAIL = array (
'active'	=> get_conf_param('mail_active'),
'host'	=> get_conf_param('mail_host'),
'port'	=> get_conf_param('mail_port'),
'auth'	=> get_conf_param('mail_auth'),
'auth_type' => get_conf_param('mail_auth_type'),
'username'	=> get_conf_param('mail_username'),
'password'	=> get_conf_param('mail_password'),
'from'	=> get_conf_param('mail_from'),
'debug' => 'false'
);

if ($CONF_AT['debug_mode'] == true) {
error_reporting(E_ALL ^ E_NOTICE);
error_reporting(0);
}

include_once('inc/mail.php');

function get_version(){
  $v = '1.06';
  return $v;
}

function get_user_lang(){
    global $dbConnection;


    $mid=$_SESSION['dilema_user_id'];
    $stmt = $dbConnection->prepare('SELECT lang from users where id=:mid');
    $stmt->execute(array(':mid' => $mid));
    $max = $stmt->fetch(PDO::FETCH_NUM);

    $max_id=$max[0];
    $length = strlen(utf8_decode($max_id));
    if (($length < 1) || $max_id == "0") {$ress='ru';} else {$ress=$max_id;}
    return $ress;
}

function get_lang($in){

  $lang2 = get_user_lang();<commit_msg>Небольшие исправления и улучшения<commit_after><?php
include_once("config.php");
define("DIR_ROOT", __DIR__);
define("DS", DIRECTORY_SEPARATOR);
include_once('sys/Parsedown.php');
include_once('sys/class.phpmailer.php');
require 'library/HTMLPurifier.auto.php';
date_default_timezone_set('Europe/Moscow');
$dbConnection = new PDO(
    'mysql:host='.$CONF_DB['host'].';dbname='.$CONF_DB['db_name'],
    $CONF_DB['username'],
    $CONF_DB['password'],
    array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
);
$dbConnection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$dbConnection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$CONF = array (
'title_header'	=> get_conf_param('title_header'),
'hostname'	=> get_conf_param('hostname'),
'mail'	=> get_conf_param('mail'),
'name_of_firm'	=> get_conf_param('name_of_firm'),
'fix_subj'	=> get_conf_param('fix_subj'),
'first_login'	=> get_conf_param('first_login'),
'file_types' => get_conf_param('file_types'),
'file_types_img' => get_conf_param('file_types'),
'file_size' => get_conf_param('file_size'),
'permit_users_knt' => get_conf_param('permit_users_knt'),
'permit_users_req' => get_conf_param('permit_users_req'),
'permit_users_cont' => get_conf_param('permit_users_cont'),
'permit_users_documents' => get_conf_param('permit_users_documents'),
'permit_users_news' => get_conf_param('permit_users_news'),
'permit_users_license' => get_conf_param('permit_users_license'),
'default_org' => get_conf_param('default_org'),
'what_cartridge' => get_conf_param('what_cartridge'),
'what_print_test' => get_conf_param('what_print_test'),
'what_license' => get_conf_param('what_license'),
'home_text' => get_conf_param('home_text')
);

$CONF_MAIL = array (
'active'	=> get_conf_param('mail_active'),
'host'	=> get_conf_param('mail_host'),
'port'	=> get_conf_param('mail_port'),
'auth'	=> get_conf_param('mail_auth'),
'auth_type' => get_conf_param('mail_auth_type'),
'username'	=> get_conf_param('mail_username'),
'password'	=> get_conf_param('mail_password'),
'from'	=> get_conf_param('mail_from'),
'debug' => 'false'
);

if ($CONF_AT['debug_mode'] == true) {
error_reporting(E_ALL ^ E_NOTICE);
error_reporting(0);
}

include_once('inc/mail.php');

function get_version(){
  $v = '1.07';
  return $v;
}

function get_user_lang(){
    global $dbConnection;


    $mid=$_SESSION['dilema_user_id'];
    $stmt = $dbConnection->prepare('SELECT lang from users where id=:mid');
    $stmt->execute(array(':mid' => $mid));
    $max = $stmt->fetch(PDO::FETCH_NUM);

    $max_id=$max[0];
    $length = strlen(utf8_decode($max_id));
    if (($length < 1) || $max_id == "0") {$ress='ru';} else {$ress=$max_id;}
    return $ress;
}

function get_lang($in){

  $lang2 = get_user_lang();
{'fraction_non_alphanumeric': 0.19155963302752294, 'fraction_numerical': 0.003669724770642202, 'mean_word_length': 8.839350180505415, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 75, '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': '7005764', 'n_tokens_mistral': 2098, 'n_tokens_neox': 2083, 'n_words': 268}