Version stable, aprelic, connexion CFRS et autres corrections
This commit is contained in:
1 parent
865de8a976
commit
e9d0010451
62 files changed
+17483
-7256
No files matched your search
+19
-5
@@ -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;
|
||||
Reference in new issue
Block a user