Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
Fixes calling setlocale.
setlocale
requires a string as a second argument (https://www.php.net/manual/en/function.setlocale.php). The current code passesnull
instead of"0"
for reading the locale value - on my machine it was causing502 Gateway Error
.Also set
skipEmpty
totrue
when getting the locale from system settings - as this setting is present and empty by default, so it was using the empty string value instead of the value obtained by callingsetlocale(LC_ALL, '0')
.Tested it on php 7.4, 8.0 and 8.1 (7.4 didn't have this issue, probably because it doesn't care about argument types).
Why is it needed?
I'm not 100% sure about the setup needed for this, but for some instances NGINX was returning 502 gateway error. Also I'd say it's better to pass correct arguments to functions :)
How to test
Not sure :)
Related issue(s)/PR(s)
n/a