Ensure to correctly parse lang
tracking parameter
#22078
Merged
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.
Description:
Matomo by defaults detects the language of a tracked visitor by parsing the http language header. As that one might not be available in all cases, the tracking API in addition allows to overwrite this by send the
lang
parameter.The tracking api documentation says:
An override value for the Accept-Language HTTP header field
This indicates that the provided value should be handled the same as the header value. In fact its the case, that the handling currently differs, as for the header value a `strtolower´ and some sort of clean up is applied here:
matomo/core/Common.php
Lines 836 to 847 in 9183cc6
This is currently not done for the
lang
parameter, as it is used as is. This PR applies a simple change, so that cleanup will be done in that case as well.fixes #22077
Review