Fix router matching for underscored route params

This commit is contained in:
Jeppe Bundgaard
2026-06-30 13:10:06 +02:00
parent c6cf953ede
commit f7a4126718
2 changed files with 17 additions and 1 deletions
+1 -1
View File
@@ -89,7 +89,7 @@ class router
}
// Regex
$route = str_replace('/', '\/', $route);
$route = preg_replace('/{[a-zA-Z0-9]+}/', '([a-zA-Z0-9]+)', $route);
$route = preg_replace('/{[a-zA-Z0-9_]+}/', '([a-zA-Z0-9]+)', $route);
if (preg_match('/^' . $route . '$/', $this->url)) {
return true;
}