1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-05-07 00:04:04 +00:00

Make in-memory DB detection more strict

In-memory DBs have to start with "file:_tenancy_inmemory_". This prevents path traversal.
This commit is contained in:
lukinovec 2026-05-01 13:09:37 +02:00
parent b1f0d0a43c
commit 7363318f6e
2 changed files with 8 additions and 4 deletions

View file

@ -155,6 +155,6 @@ class SQLiteDatabaseManager implements TenantDatabaseManager
public static function isInMemory(string $name): bool
{
return $name === ':memory:' || str_contains($name, '_tenancy_inmemory_');
return $name === ':memory:' || str_starts_with($name, 'file:_tenancy_inmemory_');
}
}