Skip to content

Form conditions: case-insensitive text comparison works only for ASCII letters (Cyrillic is compared case-sensitively) #26506

Todo

Description

@Marat-209

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

11.0 (checked on the 11.0/bugfixes and main branches, 2026-11-30)

Bug description

In the form editor, text conditions ("is equal to", "contains", ...) compare values without regard to case only for Latin letters. For Cyrillic letters the case is taken into account, so a condition that looks correct silently does not match.

The same happens with accented Latin letters (for example "É" / "é").

Who is affected: the requester does not see the section or question that should open for his answer and submits an incomplete request; the form administrator sees a condition that looks correct, does not work and reports nothing.

Steps To reproduce

  1. Create a form with two questions. Question 1 is "Short text". Question 2 has the visibility condition: question 1 contains пароль.
  2. Type Пароль in question 1: question 2 does not appear. Type пароль: it appears.
  3. With Latin text (password in the condition, Password in the answer) the condition matches in both cases.

Anything else?

Cause: the values are lowercased with strtolower(), which converts ASCII letters only. This is done in five condition handlers (line numbers from 11.0/bugfixes):

  • src/Glpi/Form/Condition/ConditionHandler/StringConditionHandler.php, lines 91-92
  • ItemAsTextConditionHandler.php, lines 89-90
  • SingleChoiceFromValuesConditionHandler.php, lines 89-90
  • UserDevicesAsTextConditionHandler.php, lines 91-92
  • AbstractDateTimeConditionHandler.php, lines 68-69

Check on PHP 8.5:

var_dump(strtolower("Пароль") === strtolower("пароль"));       // false
var_dump(mb_strtolower("Пароль") === mb_strtolower("пароль")); // true
var_dump(strtolower("ÉCOLE") === strtolower("école"));         // false
var_dump(mb_strtolower("ÉCOLE") === mb_strtolower("école"));   // true

Proposed fix: replace strtolower() with mb_strtolower() in these five handlers (10 lines) and add test cases with Cyrillic text to StringConditionHandlerTest. We have this patch with tests ready and can open a pull request against 11.0/bugfixes if you agree.

The issue does not depend on plugins: it was reproduced by calling the core functions directly.

Activity

  1. added theissue type on Nov 30, 2026
  2. self-assigned this
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions