85.195.39.11 - - [11/Jul/2019:03:17:49 +0300] "GET / HTTP/1.0" 200 33215 "https://moskovskaya-oblast.site.ru/new_posting.php" "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36"
RewriteCond %{HTTP_HOST} !www.site.ru$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-_]+).site.ru [NC]
RewriteRule (.*) %{SCRIPT_FILENAME}?crt_city=%2 [NC,QSA]
session.cookie_domain ".site.ru"
session_set_cookie_params(0, '/', '.'.$main_domain);
session
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx
Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn Off Off
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path /var/www/site/data/bin-tmp/ /var/www/site/data/bin-tmp/
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies On On
session.use_trans_sid 0 0
define('TABLE_BADWORDS', $config_table_prefix.'badwords');
define('TABLE_BANNERS',$config_table_prefix.'banners');
define('TABLE_BANNERS_POSITIONS',$config_table_prefix.'banners_positions');
и т.д
function my_session_start() {
global $settings;
$session_name = session_name("oxss");
if(($settings['enable_locations'] && $settings['enable_subdomains'])) {
global $main_domain;
session_set_cookie_params(0, '/', '.'.$main_domain);
}
session_start();
}
public function setPostLocation($post_locations_array)
{
global $config_abs_path;
global $settings;
global $main_domain;
require_once $config_abs_path . "/classes/depending_fields.php";
$array_loc = $this->getFields();
foreach ($post_locations_array as $field => $val) {
if (!in_array($field, $array_loc)) {
continue;
}
$location_str = $this->getLocations($field);
$array_loc1 = explode("|", $location_str);
if ($val && !in_array($val, $array_loc1)) {
continue;
}
$found = 0;
for ($i = 0; $i < count($array_loc); $i++) {
if ($array_loc[$i] == $field) {
$found = 1;
continue;
}
if (!$found) {
continue;
}
unset($_COOKIE["location_" . $array_loc[$i]]);
setcookie("location_" . $array_loc[$i], "", time() - 3600, "/", "." . $main_domain);
}
global $location_array;
$location_array[$field] = $val;
if (!$val && !empty($_COOKIE["location_" . $field]) || $val && empty($_COOKIE["location_" . $field]) || !empty($_COOKIE["location_" . $field]) && $val != $_COOKIE["location_" . $field]) {
$expire = time() + 60 * 60 * 24 * 365;
setcookie("location_" . $field, $val, $expire, "/", "." . $main_domain);
}
if ($settings["enable_subdomains"] && $field == $settings["subdomain_field"]) {
my_session_start();
$_SESSION["location_set"] = 1;
}
}
return 1;
}
<?php
require_once "../config.php";
global $config_abs_path;
require_once $config_abs_path."/include/include.php";
require_once $config_abs_path."/classes/locations.php";
global $appearance_settings, $settings;
header('Content-type: text/html; charset='.$appearance_settings['charset']);
global $settings;
$fields = $settings['location_fields'];
$sarr = explode(",", $fields);
// refine search
if(isset($_POST['direct']) && $_POST['direct']) {
if((!isset($_POST['field']) || !$_POST['field']) || !in_array($_POST['field'], $sarr) ) exit(0);
$field = urldecode($_POST['field']);
$crt_loc = urldecode($_POST['location']);
$new_locations_array[$field] = $crt_loc;
}
elseif(isset($_POST['double_type']) && $_POST['double_type']) {
if((!isset($_POST['field1']) || !$_POST['field1'] || !isset($_POST['field2']) || !$_POST['field2']) || !in_array($_POST['field1'], $sarr) || !in_array($_POST['field2'], $sarr) ) exit(0);
$field1 = urldecode($_POST['field1']);
$crt_loc1 = urldecode($_POST['location1']);
$field2 = urldecode($_POST['field2']);
$crt_loc2 = urldecode($_POST['location2']);
$new_locations_array[$field1] = $crt_loc1;
$new_locations_array[$field2] = $crt_loc2;
}
// location filter box
else {
$new_locations_array = array();
foreach($sarr as $s) {
$new_locations_array[$s] = $_POST[$s];
}
}
my_session_start();
$lclass = new locations();
$lclass->init();
$lclass->setPostLocation($new_locations_array);
?>
function my_session_start() {
global $settings;
$session_name = session_name("oxss");
if(($settings['enable_locations'] && $settings['enable_subdomains'])) {
global $main_domain;
session_set_cookie_params(0, '/', '.'.$main_domain);
}
session_start();
}
<?php
require_once "../config.php";
global $config_abs_path;
require_once $config_abs_path."/include/include.php";
require_once $config_abs_path."/classes/locations.php";
global $appearance_settings, $settings;
header('Content-type: text/html; charset='.$appearance_settings['charset']);
global $settings;
$fields = $settings['location_fields'];
$sarr = explode(",", $fields);
// refine search
if(isset($_POST['direct']) && $_POST['direct']) {
if((!isset($_POST['field']) || !$_POST['field']) || !in_array($_POST['field'], $sarr) ) exit(0);
$field = urldecode($_POST['field']);
$crt_loc = urldecode($_POST['location']);
$new_locations_array[$field] = $crt_loc;
}
elseif(isset($_POST['double_type']) && $_POST['double_type']) {
if((!isset($_POST['field1']) || !$_POST['field1'] || !isset($_POST['field2']) || !$_POST['field2']) || !in_array($_POST['field1'], $sarr) || !in_array($_POST['field2'], $sarr) ) exit(0);
$field1 = urldecode($_POST['field1']);
$crt_loc1 = urldecode($_POST['location1']);
$field2 = urldecode($_POST['field2']);
$crt_loc2 = urldecode($_POST['location2']);
$new_locations_array[$field1] = $crt_loc1;
$new_locations_array[$field2] = $crt_loc2;
}
// location filter box
else {
$new_locations_array = array();
foreach($sarr as $s) {
$new_locations_array[$s] = $_POST[$s];
}
}
my_session_start();
$lclass = new locations();
$lclass->init();
$lclass->setPostLocation($new_locations_array);
?>
public function setPostLocation($post_locations_array)
{
global $config_abs_path;
global $settings;
global $main_domain;
require_once $config_abs_path . "/classes/depending_fields.php";
$array_loc = $this->getFields();
foreach ($post_locations_array as $field => $val) {
if (!in_array($field, $array_loc)) {
continue;
}
$location_str = $this->getLocations($field);
$array_loc1 = explode("|", $location_str);
if ($val && !in_array($val, $array_loc1)) {
continue;
}
$found = 0;
for ($i = 0; $i < count($array_loc); $i++) {
if ($array_loc[$i] == $field) {
$found = 1;
continue;
}
if (!$found) {
continue;
}
unset($_COOKIE["location_" . $array_loc[$i]]);
setcookie("location_" . $array_loc[$i], "", time() - 3600, "/", "." . $main_domain);
}
global $location_array;
$location_array[$field] = $val;
if (!$val && !empty($_COOKIE["location_" . $field]) || $val && empty($_COOKIE["location_" . $field]) || !empty($_COOKIE["location_" . $field]) && $val != $_COOKIE["location_" . $field]) {
$expire = time() + 60 * 60 * 24 * 365;
setcookie("location_" . $field, $val, $expire, "/", "." . $main_domain);
}
if ($settings["enable_subdomains"] && $field == $settings["subdomain_field"]) {
my_session_start();
$_SESSION["location_set"] = 1;
}
}
return 1;
}
и кстати говоря в
также подключается form.php
и я смотрю в нем нет
my_session_start();
перед$lclass = new locations();
, как было в set_location.php