What happened?
The Page Titles filter is not fully case-insensitive for the Swedish characters å, ä and ö.
For example, searching for öppettider does not find the page title Öppettider.
However, Öppettider, ÖPPETTIDER and ÖpPeTtIdEr all find the same page title.
What should happen?
The Page Titles filter should be case-insensitive for Unicode characters as well.
Searching for öppettider should find Öppettider, just as searches with different casing of the other letters do.
How can this be reproduced?
- Go to Behavior → Page Titles.
- Search for Öppettider → the page title is found.
- Search for ÖPPETTIDER → the page title is found.
- Search for ÖpPeTtIdEr → the page title is found.
- Search for öppettider → the page title is not found.
The issue appears to be related to the regex matching in:
core/DataTable/Filter/Pattern.php
The current code uses the case-insensitive regex modifier i:
preg_match($patternQuoted . "i", $string)
Changing it to use the Unicode modifier as well:
preg_match($patternQuoted . "iu", $string)
fixes the issue. After this change, öppettider correctly matches Öppettider.
The same issue is expected to affect å/Å and ä/Ä.
Matomo version
5.11.1
PHP version
8.4.3
Server operating system
No response
What browsers are you seeing the problem on?
No response
Computer operating system
No response
Relevant log output
Validations
What happened?
The Page Titles filter is not fully case-insensitive for the Swedish characters å, ä and ö.
For example, searching for öppettider does not find the page title Öppettider.
However, Öppettider, ÖPPETTIDER and ÖpPeTtIdEr all find the same page title.
What should happen?
The Page Titles filter should be case-insensitive for Unicode characters as well.
Searching for öppettider should find Öppettider, just as searches with different casing of the other letters do.
How can this be reproduced?
The issue appears to be related to the regex matching in:
core/DataTable/Filter/Pattern.phpThe current code uses the case-insensitive regex modifier i:
preg_match($patternQuoted . "i", $string)Changing it to use the Unicode modifier as well:
preg_match($patternQuoted . "iu", $string)fixes the issue. After this change, öppettider correctly matches Öppettider.
The same issue is expected to affect å/Å and ä/Ä.
Matomo version
5.11.1
PHP version
8.4.3
Server operating system
No response
What browsers are you seeing the problem on?
No response
Computer operating system
No response
Relevant log output
Validations