Fix syntax and error
This commit is contained in:
parent
b9af7fee09
commit
2d6f2745a6
2 changed files with 7 additions and 7 deletions
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$locale = 'en';
|
$locale = 'en';
|
||||||
foreach (explode(',', preg_replace('/[A-Z0-9]|q=|;|-|\./', '', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '') as $client_locale)) {
|
foreach (explode(',', preg_replace('/[A-Z0-9]|q=|;|-|\./', '', $_SERVER['HTTP_ACCEPT_LANGUAGE'] ?? '')) as $client_locale) {
|
||||||
if (in_array($client_locale, ['en', 'fr'], true)) {
|
if (in_array($client_locale, ['en', 'fr'], true)) {
|
||||||
$locale = $client_locale;
|
$locale = $client_locale;
|
||||||
break;
|
break;
|
||||||
|
|
12
router.php
12
router.php
|
@ -72,6 +72,12 @@ if (!TITLES_LINEAGE[array_key_last(TITLES_LINEAGE)]) {
|
||||||
exit('Page not found.');
|
exit('Page not found.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($_SERVER['SERVER_NAME']) !== true)
|
||||||
|
exit('Missing <code>$_SERVER[\'SERVER_NAME\']</code>');
|
||||||
|
if (in_array($_SERVER['SERVER_NAME'], CONF['common']['public_domains'], true) !== true)
|
||||||
|
exit('The current <code>$_SERVER[\'SERVER_NAME\']</code> is not allowed in configuration.');
|
||||||
|
define('SERVER_NAME', $_SERVER['SERVER_NAME']);
|
||||||
|
|
||||||
const SESSION_COOKIE_NAME = 'servnest-session-key';
|
const SESSION_COOKIE_NAME = 'servnest-session-key';
|
||||||
function startSession() {
|
function startSession() {
|
||||||
session_start([
|
session_start([
|
||||||
|
@ -119,12 +125,6 @@ if (isset($_SESSION['id'])) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($_SERVER['SERVER_NAME']) !== true)
|
|
||||||
output(500, 'Missing $_SERVER[\'SERVER_NAME\']');
|
|
||||||
if (in_array($_SERVER['SERVER_NAME'], CONF['common']['public_domains'], true) !== true)
|
|
||||||
output(500, 'The current server name is not allowed in configuration.');
|
|
||||||
define('SERVER_NAME', $_SERVER['SERVER_NAME']);
|
|
||||||
|
|
||||||
function displayFinalMessage($data) {
|
function displayFinalMessage($data) {
|
||||||
if (isset($data['final_message'])) {
|
if (isset($data['final_message'])) {
|
||||||
echo $data['final_message'];
|
echo $data['final_message'];
|
||||||
|
|
Loading…
Reference in a new issue