From d7dd6b4cdf0fa72aa4428287ad642847fab853ef Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Wed, 17 Apr 2024 15:29:28 +0800 Subject: [PATCH] feat: add the validation. --- system/Database/SQLSRV/Builder.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/system/Database/SQLSRV/Builder.php b/system/Database/SQLSRV/Builder.php index f01e733f9119..baa4e0406c7f 100755 --- a/system/Database/SQLSRV/Builder.php +++ b/system/Database/SQLSRV/Builder.php @@ -295,8 +295,8 @@ private function getFullName(string $table): string $database = $this->db->getDatabase(); $table = $dbInfo[0]; - if (count($dbInfo) >= 2) { - if (count($dbInfo) === 3) { + if (count($dbInfo) >= 2 && isset($dbInfo[1])) { + if (count($dbInfo) === 3 && isset($dbInfo[2])) { $database = str_replace('"', '', $dbInfo[0]); $schema = str_replace('"', '', $dbInfo[1]); $tableName = str_replace('"', '', $dbInfo[2]);