-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic route parameters not supporting non-ascii characters #35
Comments
Hi! Please check v.1.5.1 Hope it is exactly what you need. |
Nice one!
I suppose it is related to middlewares being refactored in 1.5, as it worked fine in 1.4. Is the below still correct? $router->registerMiddleware('*', function(string $route, array $parameters = []) {
// ...
return [ $route, $parameters ];
} |
I think you are right.
Since v.1.5.0 It was working like this: // for example $parameters = ['id' => 1]
$router->registerMiddleware('*', function(string $route, array $parameters = []) {
// works correct in the v.1.4.x
return [ $route, $parameters ];
} And now it is working in this way: // for the url = /user/1 and pattern /user/[i:id]
$router->registerMiddleware('*', function(string $route, int $id) {
// works correct in the v.1.5.x
return [ $route, $id];
} |
Perfect, did some adjustments to the code. Works perfectly. Well done! Thanks a lot. |
Stumbled across another issue which is related to the previous issue about non-ascii characters not being parsed correctly by the router (that was fixed in this commit).
Imagine the following scenario:
Where
language
equalsрусский
, meaning the final URL is/язык/русский
. This now results in an errorThe processor was not found for the route
.Is it possible to add support for this in the variables?
The text was updated successfully, but these errors were encountered: