Merge pull request #53 from CarloFalco/master

Bug Fix
This commit is contained in:
Catalin Novgorodschi
2024-08-01 09:34:54 +03:00
committed by GitHub
2 changed files with 23 additions and 9 deletions
+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;
}
+3 -1
View File
@@ -118,7 +118,9 @@ class MyGenerator {
public function getBaseID($x, $y){
return ((WORLD_MAX - $y) * (WORLD_MAX * 2 + 1)) + (WORLD_MAX + $x + 1);
# broken -> return ((WORLD_MAX - $y) * (WORLD_MAX * 2 + 1)) + (WORLD_MAX + $x + 1);
# OK -> return ((WORLD_MAX - $y) * (WORLD_MAX * 2 + 1)) + (WORLD_MAX - $x + 1);
return ((WORLD_MAX - $y) * (WORLD_MAX * 2 + 1)) + (WORLD_MAX - $x + 1);
}
public function getMapCheck($wref){