From 289a249569aee65de1b74bcc4db3a973b76cb3e2 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Sun, 24 Mar 2024 22:18:55 +0900 Subject: [PATCH] Automatically remove .* .+ .? in route definition regexp #2287 --- common/framework/Router.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/framework/Router.php b/common/framework/Router.php index b2302180b..9fb82b2ae 100644 --- a/common/framework/Router.php +++ b/common/framework/Router.php @@ -636,6 +636,9 @@ class Router } }, $route); + // Replace unnecessary regexp. + $route = preg_replace('/\\.[*+?]/', '', $route); + // Add a query string for the remaining arguments. return $route . (count($vars) ? ('?' . http_build_query($vars)) : ''); }