28 lines
682 B
PHP
28 lines
682 B
PHP
<?php
|
|
require_once __DIR__ . '/../config.php';
|
|
if (session_status() === PHP_SESSION_NONE) {
|
|
session_start();
|
|
}
|
|
|
|
require_once __DIR__ . '/i18n.php';
|
|
|
|
if (isset($_GET['lang'])) {
|
|
set_lang($_GET['lang']);
|
|
$uri = $_SERVER['REQUEST_URI'];
|
|
$url_parts = parse_url($uri);
|
|
$path = $url_parts['path'];
|
|
$query = [];
|
|
if (isset($url_parts['query'])) {
|
|
parse_str($url_parts['query'], $query);
|
|
unset($query['lang']);
|
|
}
|
|
$new_url = $path;
|
|
if (!empty($query)) {
|
|
$new_url .= '?' . http_build_query($query);
|
|
}
|
|
header("Location: " . $new_url);
|
|
exit;
|
|
}
|
|
|
|
require_once __DIR__ . '/auth.php';
|
|
require_once __DIR__ . '/helpers.php'; |