Allow cyrillic letters in the routes, by matching the result of urldecode over the URL .

pull/384/head
Delyan Angelov 6 years ago
parent 406be00436
commit 0daa3f81b5

@ -78,8 +78,9 @@ class Router {
* @return Route|bool Matching route or false if no match * @return Route|bool Matching route or false if no match
*/ */
public function route(Request $request) { public function route(Request $request) {
$url_decoded = urldecode( $request->url );
while ($route = $this->current()) { while ($route = $this->current()) {
if ($route !== false && $route->matchMethod($request->method) && $route->matchUrl($request->url, $this->case_sensitive)) { if ($route !== false && $route->matchMethod($request->method) && $route->matchUrl($url_decoded, $this->case_sensitive)) {
return $route; return $route;
} }
$this->next(); $this->next();

Loading…
Cancel
Save