Skip to content

Commit

Permalink
fixed out of bound exception for pattern string.
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoMario committed Apr 1, 2019
1 parent 45066f0 commit 94468dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,10 @@ public void postProcessPattern(String pattern, Map<String, Object> vendorExtensi
if(pattern != null) {
int i = pattern.lastIndexOf('/');

//Must follow Perl /pattern/modifiers convention
if(pattern.charAt(0) != '/' || i < 2) {
pattern = String.format("/%s/", pattern);
pattern = String.format("/%s/", pattern);;
i = pattern.lastIndexOf('/');
}

String regex = pattern.substring(1, i).replace("'", "\\'");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@ public void postProcessPattern(String pattern, Map<String, Object> vendorExtensi
if(pattern != null) {
int i = pattern.lastIndexOf('/');

//Must follow Perl /pattern/modifiers convention
if(pattern.charAt(0) != '/' || i < 2) {
pattern = String.format("/%s/", pattern);
i = pattern.lastIndexOf('/');
}

String regex = pattern.substring(1, i).replace("'", "\\'");
Expand Down

0 comments on commit 94468dc

Please sign in to comment.