laravel-localization icon indicating copy to clipboard operation
laravel-localization copied to clipboard

LocaleCookieRedirect redirect invalid locale

Open adriallongarriu opened this issue 2 years ago • 0 comments

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

adriallongarriu avatar Apr 07 '22 09:04 adriallongarriu