File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
APIJSON-Java-Server/APIJSONLibrary/src/main/java/zuo/biao/apijson/server Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,12 @@ public String getSchema() {
177
177
}
178
178
@ Override
179
179
public AbstractSQLConfig setSchema (String schema ) {
180
+ if (schema != null ) {
181
+ String s = schema .startsWith ("`" ) && schema .endsWith ("`" ) ? schema .substring (1 , schema .length () - 1 ) : schema ;
182
+ if (StringUtil .isName (s ) == false ) {
183
+ throw new IllegalArgumentException ("@schema:value 中value必须是1个单词!" );
184
+ }
185
+ }
180
186
this .schema = schema ;
181
187
return this ;
182
188
}
@@ -203,7 +209,7 @@ public String getTablePath() {
203
209
return getSchema () + "." + getSQLTable ();
204
210
}
205
211
@ Override
206
- public AbstractSQLConfig setTable (String table ) {
212
+ public AbstractSQLConfig setTable (String table ) { //Table已经在Parser中校验,所以这里不用防SQL注入
207
213
this .table = table ;
208
214
return this ;
209
215
}
You can’t perform that action at this time.
0 commit comments