From 4471074fa35b4376d614e753d01a520fe6e2a28c Mon Sep 17 00:00:00 2001 From: Catalin Novgorodschi <1140613+Shadowss@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:35:54 +0200 Subject: [PATCH] Update Database.php --- GameEngine/Database.php | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 2926cf3e..60b109d5 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -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; }