Skip to content

Commit 91c0892

Browse files
committed
catch user input for reverse routing searching
1 parent 8f477c6 commit 91c0892

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/java/fr/adrienbrault/idea/symfony2plugin/routing/RouteHelper.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,14 @@ private static boolean isReverseRoutePatternMatch(@NotNull Route route, @NotNull
262262
String substring = match.substring(0, i);
263263

264264
String regex = substring.replace(string, "[\\w-]+");
265-
Matcher matcher = Pattern.compile(regex).matcher(searchPath);
266-
if (matcher.matches()) {
267-
return true;
265+
266+
// user input
267+
try {
268+
Matcher matcher = Pattern.compile(regex).matcher(searchPath);
269+
if (matcher.matches()) {
270+
return true;
271+
}
272+
} catch (Exception ignored) {
268273
}
269274
}
270275

0 commit comments

Comments
 (0)