Skip to content

[Bug] Case-insensitive Page Title filtering does not match lowercase åäö #25147

Description

@ErikL98

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?

  1. Go to Behavior → Page Titles.
  2. Search for Öppettider → the page title is found.
  3. Search for ÖPPETTIDER → the page title is found.
  4. Search for ÖpPeTtIdEr → the page title is found.
  5. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Potential BugSomething that might be a bug, but needs validation and confirmation it can be reproduced.triaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions