fix: fix various PHP problems and a few bugs

This commit is contained in:
Emmanuel BENOîT 2024-12-31 11:24:12 +01:00
parent c91440af72
commit a4b45ddaa4
Signed by: Emmanuel BENOîT
SSH key fingerprint: SHA256:l7PFUUF5TCDsvYeQC9OnTNz08dFY7Fvf4Hv3neIqYpg
34 changed files with 27 additions and 66 deletions

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
include('config.inc');
include('../scripts/config.inc');
include('as_manager.inc');

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
?>

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || $_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || !$_SESSION['lw_new_game']['do_it_now'] || !$_SESSION['lw_new_game']['started']) {
echo "Sorry, can't do that.";

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
session_start();
if (!is_array($_SESSION['lw_new_game']) || $_GET['reset']) {
$_SESSION['lw_new_game'] = array(

View file

@ -9,8 +9,6 @@
Select page:
<?php
set_magic_quotes_runtime(false);
include('config.inc');
switch ($_GET['p']) {

View file

@ -6,8 +6,6 @@
<h1><a href="index.html">LWB5 > Administration</a> > Maintenance mode</h1>
<?php
set_magic_quotes_runtime(false);
include('../scripts/config.inc');
include('as_log.inc');

View file

@ -37,19 +37,19 @@ function handleInput() {
for ($y = $minY; $y <= $maxY; $y ++) {
$str = array_shift($layout);
for ($x = $minX; $x <= $maxX; $x ++) {
$type = $str{0};
$type = $str[0];
$map->setSystemType($x, $y, $type);
if ($type != 'S') {
$str = substr($str, 1);
continue;
}
$alloc = (int) $str{1};
$alloc = (int) $str[1];
$map->setSystemAlloc($x, $y, $alloc);
if ($alloc == 0) {
$str = substr($str, 2);
continue;
}
$map->setSystemSpawn($x, $y, $str{2} == '1');
$map->setSystemSpawn($x, $y, $str[2] == '1');
$str = substr($str, 3);
}
}

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
include('config.inc');
include('../scripts/config.inc');
include('as_manager.inc');

View file

@ -1,7 +1,5 @@
<?php
set_magic_quotes_runtime(false);
include('config.inc');
include('as_log.inc');