Version stable, aprelic, connexion CFRS et autres corrections

This commit is contained in:
Oleg Barykin committed 2026-04-17 20:18:11 +02:00
1 parent 865de8a976
commit e9d0010451
62 files changed
+17483 -7256

No files matched your search

+19 -5
View File
@@ -1,11 +1,25 @@
<?php
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
declare (strict_types = 1);
if (isset($_GET['lang']) && in_array($_GET['lang'], ['ru', 'fr'])) {
require_once __DIR__ . '/../../includes/bootstrap_global.php';
if (isset($_GET['lang']) && in_array($_GET['lang'], ['ru', 'fr'], true)) {
$_SESSION['lang'] = $_GET['lang'];
}
header('Location: ' . ($_SERVER['HTTP_REFERER'] ?? '/'));
$back = '/';
if (! empty($_SERVER['HTTP_REFERER'])) {
$refererPath = parse_url((string) $_SERVER['HTTP_REFERER'], PHP_URL_PATH);
$refererQuery = parse_url((string) $_SERVER['HTTP_REFERER'], PHP_URL_QUERY);
if (is_string($refererPath) && preg_match('#^/#', $refererPath)) {
$back = $refererPath;
if (is_string($refererQuery) && $refererQuery !== '') {
$back .= '?' . $refererQuery;
}
}
}
header('Location: ' . $back, true, 303);
exit;