Skip to content

Commit 6a29ef3

Browse files
committed
feat: Add more validation.
1 parent 6a6a0f2 commit 6a29ef3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

system/Database/SQLSRV/Builder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,19 +290,19 @@ private function getFullName(string $table): string
290290
}
291291

292292
if ($this->db->escapeChar === '"') {
293-
if (str_contains($table, '.')) {
293+
if (str_contains($table, '.') && !str_starts_with($table, '.') && !str_ends_with($table, '.')) {
294294
$dbInfo = explode('.', $table);
295295
$database = $this->db->getDatabase();
296-
$schema = $this->db->schema;
297296
$table = $dbInfo[0];
298297

299298
if (isset($dbInfo[1], $dbInfo[2])) {
300299
$database = str_replace('"', '', $dbInfo[0]);
301300
$schema = str_replace('"', '', $dbInfo[1]);
302301
$tableName = str_replace('"', '', $dbInfo[2]);
303-
}
304302

305303
return '"' . $database . '"."' . $schema . '"."' . str_replace('"', '', $tableName) . '"' . $alias;
304+
}
305+
306306
}
307307

308308
return '"' . $this->db->getDatabase() . '"."' . $this->db->schema . '"."' . str_replace('"', '', $table) . '"' . $alias;

0 commit comments

Comments
 (0)