ソースを参照

consolidate invalidName check

tags/2.0.1
Jonathan Cobb 4年前
コミット
6079ec3a13
1個のファイルの変更1行の追加2行の削除
  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 ファイルの表示

@@ -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) {


読み込み中…
キャンセル
保存