mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-29 10:49:22 +02:00
Merge branch 'main' into develop
This commit is contained in:
commit
9d696d31d8
@ -31,11 +31,11 @@ require_once 'common.php';
|
|||||||
require_once SYSTEM . 'functions.php';
|
require_once SYSTEM . 'functions.php';
|
||||||
|
|
||||||
$uri = $_SERVER['REQUEST_URI'];
|
$uri = $_SERVER['REQUEST_URI'];
|
||||||
if(false !== strpos($uri, 'index.php')) {
|
if(str_contains($uri, 'index.php')) {
|
||||||
$uri = str_replace_first('/index.php', '', $uri);
|
$uri = str_replace_first('/index.php', '', $uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(0 === strpos($uri, '/')) {
|
if(str_starts_with($uri, '/')) {
|
||||||
$uri = str_replace_first('/', '', $uri);
|
$uri = str_replace_first('/', '', $uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
root /home/otserv/www/public;
|
root /var/www/html;
|
||||||
index index.php;
|
index index.php;
|
||||||
server_name your-domain.com;
|
server_name your-domain.com;
|
||||||
|
|
||||||
|
@ -1018,12 +1018,19 @@ function load_config_lua($filename)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach($result as $tmp_key => $tmp_value) // load values defined by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull
|
foreach($result as $tmp_key => $tmp_value) { // load values defined by other keys, like: dailyFragsToBlackSkull = dailyFragsToRedSkull
|
||||||
$value = str_replace($tmp_key, $tmp_value, $value);
|
$value = str_replace($tmp_key, $tmp_value, $value);
|
||||||
$ret = @eval("return $value;");
|
}
|
||||||
if((string) $ret == '' && trim($value) !== '""') // = parser error
|
|
||||||
{
|
try {
|
||||||
throw new RuntimeException('ERROR: Loading config.lua file. Line <b>' . ($ln + 1) . '</b> of LUA config file is not valid [key: <b>' . $key . '</b>]');
|
$ret = eval("return $value;");
|
||||||
|
}
|
||||||
|
catch (Throwable $e) {
|
||||||
|
throw new RuntimeException('ERROR: Loading config.lua file. Line: ' . ($ln + 1) . ' - Unable to parse value "' . $value . '" - ' . $e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
if((string) $ret == '' && trim($value) !== '""') {
|
||||||
|
throw new RuntimeException('ERROR: Loading config.lua file. Line ' . ($ln + 1) . ' is not valid [key: ' . $key . ']');
|
||||||
}
|
}
|
||||||
$result[$key] = $ret;
|
$result[$key] = $ret;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user