mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-07 06:14:03 +00:00
Validate SQLite filename in databaseExists
Add validation so that a malicious tenant DB name can't be used to detect if a file exists.
This commit is contained in:
parent
75b74f2e6c
commit
322257f456
2 changed files with 17 additions and 1 deletions
|
|
@ -128,7 +128,13 @@ class SQLiteDatabaseManager implements TenantDatabaseManager
|
|||
|
||||
public function databaseExists(string $name): bool
|
||||
{
|
||||
return $this->isInMemory($name) || file_exists($this->getPath($name));
|
||||
if ($this->isInMemory($name)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->validateParameter($name);
|
||||
|
||||
return file_exists($this->getPath($name));
|
||||
}
|
||||
|
||||
public function makeConnectionConfig(array $baseConfig, string $databaseName): array
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue