fix: 校验数据库名称

This commit is contained in:
taojinlong 2023-07-12 10:11:49 +08:00
parent 0ded6da605
commit 6031af3663

View File

@ -796,7 +796,7 @@ public class JdbcProvider extends DefaultJdbcProvider {
break; break;
case sqlServer: case sqlServer:
SqlServerConfiguration sqlServerConfiguration = new Gson().fromJson(datasource.getConfiguration(), SqlServerConfiguration.class); SqlServerConfiguration sqlServerConfiguration = new Gson().fromJson(datasource.getConfiguration(), SqlServerConfiguration.class);
if(!sqlServerConfiguration.getDataBase().matches("^[0-9a-zA-Z_-]{1,}$")){ if(!sqlServerConfiguration.getDataBase().matches("^[0-9a-zA-Z_.-]{1,}$")){
throw new Exception("Invalid database name"); throw new Exception("Invalid database name");
} }
break; break;