laravel-localization
laravel-localization copied to clipboard
LocaleCookieRedirect redirect invalid locale
Describe the bug
The Middleware LocaleCookieRedirect in line 59 use $params[0]
insed of $locale
. Variable params are not validate with the funcion checkLocaleInSupportedLocales()
this cause to store incorrect values inside cookies.
https://github.com/mcamara/laravel-localization/blob/27565315c585e90d8d93aa06afd49d6a5992fe5a/src/Mcamara/LaravelLocalization/Middleware/LocaleCookieRedirect.php#L59
Expected behavior
Ignore $params[0]
if is not a supported locale and don't sotre value to cookies.
More info:
- Version of Laravel: v5.8.38
- Version of the Laravel-localization package: v1.7.0