Ver código fonte

consolidate invalidName check

tags/2.0.1
Jonathan Cobb 4 anos atrás
pai
commit
6079ec3a13
1 arquivos alterados com 1 adições e 2 exclusões
  1. +1
    -2
      wizard-server/src/main/java/org/cobbzilla/wizard/server/listener/SystemInitializerListener.java

+ 1
- 2
wizard-server/src/main/java/org/cobbzilla/wizard/server/listener/SystemInitializerListener.java Ver arquivo

@@ -107,7 +107,6 @@ public class SystemInitializerListener extends RestServerLifecycleListenerBase {
public boolean checkTable(PgRestServerConfiguration config) {
if (checkTable) {
final String tableName = getCheckTableName(config);
if (!checkSafeShellArg(tableName)) invalidName("invalid table name", tableName);
try {
return runTableCheck(config, tableName);
} catch (Exception e) {
@@ -119,6 +118,7 @@ public class SystemInitializerListener extends RestServerLifecycleListenerBase {
}

public boolean runTableCheck(PgRestServerConfiguration config, String tableName) {
if (!checkSafeShellArg(tableName)) invalidName("invalid table name", tableName);
final ResultSetBean rs = config.execSql("select * from " + tableName + " limit 1");
return rs != null && rs.rowCount() <= 1;
}
@@ -127,7 +127,6 @@ public class SystemInitializerListener extends RestServerLifecycleListenerBase {
if (checkTable) {
final PgRestServerConfiguration config = (PgRestServerConfiguration) server.getConfiguration();
final String tableName = getCheckTableName(config);
if (!checkSafeShellArg(tableName)) invalidName("invalid table name", tableName);
try {
runTableCheck(config, tableName);
} catch (Exception e) {


Carregando…
Cancelar
Salvar