mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-11 05:41:01 +00:00
Some important fix
This commit is contained in:
@@ -13,7 +13,11 @@
|
||||
|
||||
// #299: load CSRF helpers + admin_deny() before the access check below.
|
||||
require_once(__DIR__ . '/../csrf.php');
|
||||
session_start();
|
||||
|
||||
// csrf.php porneste deja sesiunea; un al doilea apel doar genereaza un Notice.
|
||||
if (session_status() === PHP_SESSION_NONE) {
|
||||
session_start();
|
||||
}
|
||||
|
||||
include_once("../../config.php");
|
||||
include_once("../../Database.php");
|
||||
|
||||
@@ -45,6 +45,23 @@ if ( !defined('AUTOMATION_MANUAL_RUN') ) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Automation.php presupunea ca apelantul a inclus deja config.php. Cand nu era
|
||||
* asa (de exemplu inclus din alt context), Database.php dadea eroare fatala:
|
||||
* Undefined constant "SQL_SERVER"
|
||||
*
|
||||
* Il incarcam noi daca lipseste. include_once nu-l aduce de doua ori.
|
||||
*/
|
||||
if (!defined('SQL_SERVER')) {
|
||||
$automationConfig = __DIR__ . '/config.php';
|
||||
|
||||
if (is_file($automationConfig)) {
|
||||
include_once($automationConfig);
|
||||
} elseif (is_file(__DIR__ . '/../config.php')) {
|
||||
include_once(__DIR__ . '/../config.php');
|
||||
}
|
||||
}
|
||||
|
||||
include_once("Database.php");
|
||||
include_once("Data/buidata.php");
|
||||
include_once("Data/unitdata.php");
|
||||
|
||||
@@ -578,7 +578,9 @@ class Units {
|
||||
$j = 1;
|
||||
for ( $i = $start; $i <= $end; $i ++ ) {
|
||||
$units[] = $i;
|
||||
$amounts[] = $post[ 't' . $j . '' ];
|
||||
// Formularul trimite doar casutele completate; o unitate necompletata
|
||||
// inseamna zero trupe din tipul acela.
|
||||
$amounts[] = isset($post['t'.$j]) ? $post['t'.$j] : 0;
|
||||
$modes[] = 0;
|
||||
$j ++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user