<commit_before><?php
//setlocale(LC_ALL, 'ru_RU');
// ---- center ----
unset($parsed_res);
$Page = new Page();
$Page->PagesList();
$tpl->Assign('list_menu', $Page->list);
$header = 'Результаты поиска';
$GLOBALS['IERA_LINKS'][] = array(
	'title' => $header,
	'url' => Link::Custom('search')
);

// Настройка панели действий ===============================
$list_controls = array('layout', 'sorting');
$tpl->Assign('list_controls', $list_controls);
// =========================================================

if(isset($_SERVER['HTTP_REFERER'])){
	$referer = explode('/',str_replace('http://', '', $_SERVER['HTTP_REFERER']));
	if($referer[1] != 'search'){
		unset($_SESSION['search']);
		unset($_SESSION['filters']);
	}
}else{
	unset($_SESSION['search']);
	unset($_SESSION['filters']);
}
$products = new Products();



// Получаем строку поискового запроса ======================
if(isset($_POST['query']) && !isset($_GET['query']) && $_POST['query'] != ''){
	$query = preg_replace('/[()*|,.*"^&@#$%\/]/', ' ', $_POST['query']);
	$query = trim($query);
}elseif(isset($_GET['query']) && !isset($_POST['query']) && $_GET['query'] != ''){
	$query = preg_replace('/[()*|,.*"^&@#$%]/', ' ', $_GET['query']);
	$query = trim($query);
}
G::metaTags(array('page_title' => $header.' по запросу "'.$query.'"'));
$tpl->Assign('header', $header.' по запросу "'.$query.'"');
if(isset($_SESSION['search']['query']) && isset($query) && $query != '' && $query != $_SESSION['search']['query']){
	$_SESSION['search']['newsearch'] = 1;
	$_POST['dropfilters'] = 1;
}else{
	$_SESSION['search']['newsearch'] = 0;
}
if((isset($_SESSION['search']['query']) && $_SESSION['search']['query'] != '') && (!isset($query) || $query == '')){
	$query = $_SESSION['search']['query'];
}elseif((isset($query) && $query != '') || !isset($_SESSION['search']['query']) || $_SESSION['search']['query'] == ''){
	if(isset($query)){
		$_SESSION['search']['query'] = $query;
	}else{
		$_SESSION['search']['query'] = $query = '';<commit_msg>Исправление появления ошибок при пустом запросе поиска<commit_after><?php
//setlocale(LC_ALL, 'ru_RU');
// ---- center ----
unset($parsed_res);
$Page = new Page();
$Page->PagesList();
$tpl->Assign('list_menu', $Page->list);
$header = 'Результаты поиска';
$GLOBALS['IERA_LINKS'][] = array(
	'title' => $header,
	'url' => Link::Custom('search')
);

// Настройка панели действий ===============================
$list_controls = array('layout', 'sorting');
$tpl->Assign('list_controls', $list_controls);
// =========================================================

if(isset($_SERVER['HTTP_REFERER'])){
	$referer = explode('/',str_replace('http://', '', $_SERVER['HTTP_REFERER']));
	if($referer[1] != 'search'){
		unset($_SESSION['search']);
		unset($_SESSION['filters']);
	}
}else{
	unset($_SESSION['search']);
	unset($_SESSION['filters']);
}
$products = new Products();



// Получаем строку поискового запроса ======================
if(isset($_POST['query']) && !isset($_GET['query']) && $_POST['query'] != ''){
	$query = preg_replace('/[()*|,.*"^&@#$%\/]/', ' ', $_POST['query']);
	$query = trim($query);
}elseif(isset($_GET['query']) && !isset($_POST['query']) && $_GET['query'] != ''){
	$query = preg_replace('/[()*|,.*"^&@#$%]/', ' ', $_GET['query']);
	$query = trim($query);
}
G::metaTags(array('page_title' => $header.' по запросу "'.isset($query).'"'));
$tpl->Assign('header', $header.' по запросу "'.isset($query).'"');
if(isset($_SESSION['search']['query']) && isset($query) && $query != '' && $query != $_SESSION['search']['query']){
	$_SESSION['search']['newsearch'] = 1;
	$_POST['dropfilters'] = 1;
}else{
	$_SESSION['search']['newsearch'] = 0;
}
if((isset($_SESSION['search']['query']) && $_SESSION['search']['query'] != '') && (!isset($query) || $query == '')){
	$query = $_SESSION['search']['query'];
}elseif((isset($query) && $query != '') || !isset($_SESSION['search']['query']) || $_SESSION['search']['query'] == ''){
	if(isset($query)){
		$_SESSION['search']['query'] = $query;
	}else{
		$_SESSION['search']['query'] = $query = '';
{'fraction_non_alphanumeric': 0.34825624536235467, 'fraction_numerical': 0.001978728666831561, 'mean_word_length': 7.372670807453416, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '3674311', 'n_tokens_mistral': 1403, 'n_tokens_neox': 1410, 'n_words': 206}