Update Database.php

Fix issue "Building orders are canceled after the attack in WW village"
This commit is contained in:
CarloFalco
2024-07-13 17:19:46 +02:00
committed by GitHub
parent d5495257f4
commit 27c0a2f10b
+20 -8
View File
@@ -705,14 +705,26 @@ class MYSQLi_DB implements IDbConnection {
$arg_list = func_get_args();
$ret = [];
for ($i = 0; $i < $numargs; $i++) {
if (is_string($arg_list[$i])) {
$arg_list[$i] = stripslashes($arg_list[$i]);
$res[] = mysqli_real_escape_string($this->dblink, $arg_list[$i]);
} else {
$res[] = $arg_list[$i];
}
}
for ($i = 0; $i < $numargs; $i++) {
if (is_array($arg_list[$i])) {
// array handling
$escaped_array = [];
foreach ($arg_list[$i] as $item) {
if (is_string($item)) {
$item = stripslashes($item);
$escaped_array[] = mysqli_real_escape_string($this->dblink, $item);
} else {
$escaped_array[] = (int)$item;
}
}
$res[] = $escaped_array;
} elseif (is_string($arg_list[$i])) {
$arg_list[$i] = stripslashes($arg_list[$i]);
$res[] = mysqli_real_escape_string($this->dblink, $arg_list[$i]);
} else {
$res[] = (int)$arg_list[$i];
}
}
return $res;
}