From dbd7ac86a956f7f8efceb5385d0e8d2979d57603 Mon Sep 17 00:00:00 2001 From: Jakob Vogel Date: Wed, 25 Oct 2023 12:54:53 +0200 Subject: [PATCH] =?UTF-8?q?Extends=20pattern=20to=20accept=20dashes=20as?= =?UTF-8?q?=20well=20=F0=9F=91=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dash is not necessary for production use, but for tests. --- src/main/java/sirius/biz/web/BizController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/sirius/biz/web/BizController.java b/src/main/java/sirius/biz/web/BizController.java index e2604b5c3..375a8a4e7 100644 --- a/src/main/java/sirius/biz/web/BizController.java +++ b/src/main/java/sirius/biz/web/BizController.java @@ -705,7 +705,7 @@ protected void redirectToSaneReferer(final WebContext webContext, Pattern patter * @see #redirectToSaneReferer(WebContext, Pattern, String) */ protected static Pattern createPatternForOverviewAndDetailRoutes(String overviewRoute, String detailRoutePrefix) { - return Pattern.compile("^(" + Pattern.quote(detailRoutePrefix) + "\\w+|" + Pattern.quote(overviewRoute) + ")$"); + return Pattern.compile("^(" + Pattern.quote(detailRoutePrefix) + "[0-9a-zA-Z_\\-]+|" + Pattern.quote(overviewRoute) + ")$"); } /**