Skip to content

Commit

Permalink
Update Database.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Shadowss authored Oct 31, 2024
1 parent 66ac53f commit 4471074
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions GameEngine/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,26 +705,14 @@ function escape_input() {
$arg_list = func_get_args();
$ret = [];

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];
}
}
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];
}
}

return $res;
}
Expand Down

0 comments on commit 4471074

Please sign in to comment.