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() {
177177 }
178178 @ Override
179179 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+ }
180186 this .schema = schema ;
181187 return this ;
182188 }
@@ -203,7 +209,7 @@ public String getTablePath() {
203209 return getSchema () + "." + getSQLTable ();
204210 }
205211 @ Override
206- public AbstractSQLConfig setTable (String table ) {
212+ public AbstractSQLConfig setTable (String table ) { //Table已经在Parser中校验,所以这里不用防SQL注入
207213 this .table = table ;
208214 return this ;
209215 }
You can’t perform that action at this time.
0 commit comments