IDEMPIERE-4900 SQL statement added as an option to define WF Next Node Condition (#1049)

Fix wrong matches pattern -> eclipse 2021-12 complains with error
Invalid escape sequence (valid ones are  \b  \t  \n  \f  \r  \"  \'  \\ )
This commit is contained in:
Carlos Ruiz 2021-12-13 14:41:35 +01:00 committed by GitHub
parent 2c89382aca
commit e5344194a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2610,7 +2610,7 @@ public final class DB
String removeQuotedStrings = "'(?:.|[\\n\\r])*?'"; String removeQuotedStrings = "'(?:.|[\\n\\r])*?'";
String removeLeadingSpaces = "^\\s+"; String removeLeadingSpaces = "^\\s+";
String cleanSql = sql.toLowerCase().replaceAll(removeComments, "").replaceAll(removeQuotedStrings, "").replaceFirst(removeLeadingSpaces, ""); String cleanSql = sql.toLowerCase().replaceAll(removeComments, "").replaceAll(removeQuotedStrings, "").replaceFirst(removeLeadingSpaces, "");
if(cleanSql.matches("^select\s.*$") && !cleanSql.contains(";")) if(cleanSql.matches("^select\\s.*$") && !cleanSql.contains(";"))
return true; return true;
else else
return false; return false;