<commit_before><?php

require 'common.php';
require SITE_DIR . 'includes/bbcode.php';
require SITE_DIR . 'includes/functions_post.php';
require SITE_DIR . 'attach_mod/attachment_mod.php';

$page_cfg['load_tpl_vars'] = array(
	'post_icons',
);

$submit      = (bool) @$_REQUEST['post'];
$preview     = (bool) @$_REQUEST['preview'];
$delete      = (bool) @$_REQUEST['delete'];
$poll_delete = (bool) @$_REQUEST['poll_delete'];
$poll_add    = (bool) @$_REQUEST['add_poll_option'];
$poll_edit   = (bool) @$_REQUEST['edit_poll_option'];
$topic_tpl   = (bool) @$_REQUEST['tpl'];

$forum_id = (int) @$_REQUEST[POST_FORUM_URL];
$topic_id = (int) @$_REQUEST[POST_TOPIC_URL];
$post_id  = (int) @$_REQUEST[POST_POST_URL];

$mode = (string) @$_REQUEST['mode'];

$confirm = isset($_POST['confirm']);

$poll_id = null;

$refresh = $preview || $poll_add || $poll_edit || $poll_delete;
$orig_word = $replacement_word = array();

// Set topic type
$topic_type = (@$_POST['topictype']) ? (int) $_POST['topictype'] : POST_NORMAL;
$topic_type = in_array($topic_type, array(POST_NORMAL, POST_STICKY, POST_ANNOUNCE)) ? $topic_type : POST_NORMAL;

if ($mode == 'smilies')
{
	generate_smilies('window');
	exit;
}

$tracking_topics = get_tracks('topic');
$tracking_forums = get_tracks('forum');

// Start session management
$user->session_start();

// Quick Reply
$template->assign_vars(array(
	'L_FONT_SEL'         => $lang['QR_Font_sel'],
	'L_FONT_COLOR_SEL'   => $lang['QR_Color_sel'],
	'L_FONT_SIZE_SEL'    => $lang['QR_Size_sel'],
	'L_STEEL_BLUE'       => $lang['color_steel_blue'],<commit_msg>Совместимость с php8<commit_after><?php

require 'common.php';
require SITE_DIR . 'includes/bbcode.php';
require SITE_DIR . 'includes/functions_post.php';
require SITE_DIR . 'attach_mod/attachment_mod.php';

$page_cfg['load_tpl_vars'] = array(
	'post_icons',
);

$submit      = (bool) ($_REQUEST['post'] ?? false);
$preview     = (bool) ($_REQUEST['preview'] ?? false);
$delete      = (bool) ($_REQUEST['delete'] ?? false);
$poll_delete = (bool) ($_REQUEST['poll_delete'] ?? false);
$poll_add    = (bool) ($_REQUEST['add_poll_option'] ?? false);
$poll_edit   = (bool) ($_REQUEST['edit_poll_option'] ?? false);
$topic_tpl   = (bool) ($_REQUEST['tpl'] ?? false);

$forum_id = (int) ($_REQUEST[POST_FORUM_URL] ?? 0);
$topic_id = (int) ($_REQUEST[POST_TOPIC_URL] ?? 0);
$post_id  = (int) ($_REQUEST[POST_POST_URL] ?? 0);

$mode = (string) ($_REQUEST['mode'] ?? '');

$confirm = isset($_POST['confirm']);

$poll_id = null;

$refresh = $preview || $poll_add || $poll_edit || $poll_delete;
$orig_word = $replacement_word = array();

// Set topic type
$topic_type = isset($_POST['topictype']) ? (int) $_POST['topictype'] : POST_NORMAL;
$topic_type = in_array($topic_type, array(POST_NORMAL, POST_STICKY, POST_ANNOUNCE)) ? $topic_type : POST_NORMAL;

if ($mode == 'smilies')
{
	generate_smilies('window');
	exit;
}

$tracking_topics = get_tracks('topic');
$tracking_forums = get_tracks('forum');

// Start session management
$user->session_start();

// Quick Reply
$template->assign_vars(array(
	'L_FONT_SEL'         => $lang['QR_Font_sel'],
	'L_FONT_COLOR_SEL'   => $lang['QR_Color_sel'],
	'L_FONT_SIZE_SEL'    => $lang['QR_Size_sel'],
	'L_STEEL_BLUE'       => $lang['color_steel_blue'],
{'fraction_non_alphanumeric': 0.1992619926199262, 'fraction_numerical': 0.0012300123001230013, 'mean_word_length': 6.025917926565874, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '1424756', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1229, 'n_words': 209}