Skip to content
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

[9.x] Fix overriding global locale #43426

Merged
merged 4 commits into from
Jul 26, 2022
Merged

[9.x] Fix overriding global locale #43426

merged 4 commits into from
Jul 26, 2022

Conversation

driesvints
Copy link
Member

@driesvints driesvints commented Jul 26, 2022

This PR fixes a bug where the global Locale value would be overwritten by calling setLocale. Underneath this method, Symfony sets the global Locale. Since we're not initializing the original request of the application but
rather copying an existing request, we need to prevent from overwriting the default PHP locale. We can achieve this by just setting the plain locale and plain default locale without modifying the PHP locale. I've added new methods to achieve this so there's no side effects.

Fixes #43371

@driesvints driesvints changed the title Fix overriding global locale [9.x] Fix overriding global locale Jul 26, 2022
@taylorotwell taylorotwell merged commit 41ecd77 into 9.x Jul 26, 2022
@taylorotwell taylorotwell deleted the fix-overriding-locale branch July 26, 2022 13:16
Ken-vdE pushed a commit to Ken-vdE/framework that referenced this pull request Aug 9, 2022
* Fix overriding global locale

* wip

* formatting

* Update Request.php

Co-authored-by: Taylor Otwell <taylor@laravel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using a custom FormRequest always modify the language of \Locale class from intl PHP extension
2 participants