Skip to content

Commit

Permalink
feat: allowed java Pattern class to the used into regular expressions
Browse files Browse the repository at this point in the history
Add the class java.util.regex.Pattern to the allowedClasses list in the RestrictiveGroovyInterceptor.

ING-4168
  • Loading branch information
emanuelaepure10 committed Jan 16, 2024
1 parent 1f2b804 commit 06ec4cc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import java.util.Set;
import java.util.TreeMap;
import java.util.UUID;
import java.util.regex.Pattern;

import org.codehaus.groovy.runtime.GStringImpl;
import org.codehaus.groovy.runtime.InvokerHelper;
Expand Down Expand Up @@ -146,6 +147,9 @@ public class RestrictiveGroovyInterceptor extends GroovyInterceptor {
allowedClasses.add(TextStyle.class);
allowedClasses.add(SignStyle.class);

// regular expressions
allowedClasses.add(Pattern.class);

// helper classes
allowedClasses.add(SimpleDateFormat.class);
allowedClasses.add(UUID.class);
Expand Down

0 comments on commit 06ec4cc

Please sign in to comment.