AdvancedCustomFields / AdvancedCustomFields/acf

Usage of strtolower breaks accented translations

Open
#647 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
945
Forks
197
PR merge metrics
No merged PRs in 30d

Description

In the render_field_checkbox() we use strtolower to convert the category name into lowercase. This is used to fill the show_option_none label.

https://github.com/AdvancedCustomFields/acf/blob/ada1e58a2e5564e7d62ded661ebdaf6a153ccb1f/includes/fields/class-acf-field-taxonomy.php#L671-L677

This breaks category name when it contains accented characters (e.g. Catégorie which is Category in French).

This wouls be better to use mb_strtolower function to take into account various encoding.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open includes/fields/class-acf-field-taxonomy.php around render_field_checkbox() and the referenced lines. Check how the category name is converted for the show_option_none label, then verify that accented names such as “Catégorie” remain intact and run the relevant field taxonomy tests if available.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, internationalization
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.