Pending

User tests: Successful: Unsuccessful:

avatar mmustafasenoglu
mmustafasenoglu
27 Aug 2026

Pull Request resolves #45452.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

The mod_articles_category module's truncate() method used PHP's strlen() which counts bytes, not characters. For multibyte strings like Chinese (UTF-8, 3 bytes per character), this caused incorrect length calculations. When introtext_limit was set (e.g., 30 characters), the function would compare byte lengths and fail to produce output.

Fixed by changing \strlen() to StringHelper::strlen() which wraps mb_strlen() for proper UTF-8 character counting.

Testing Instructions

  1. Create an article with Chinese content (no spaces between characters)
  2. Add mod_articles_category module to a page
  3. Set "Show Introtext" to Yes and "Introtext Limit (characters)" to 30
  4. Verify the introtext displays correctly (previously showed nothing)

Actual result BEFORE applying this Pull Request

Chinese introtext with introtext_limit set shows nothing/empty.

Expected result AFTER applying this Pull Request

Chinese introtext displays correctly truncated to the character limit.

Link to documentations

  • No documentation changes for guide.joomla.org needed
  • No documentation changes for manual.joomla.org needed
avatar mmustafasenoglu mmustafasenoglu - open - 27 Aug 2026
avatar mmustafasenoglu mmustafasenoglu - change - 27 Aug 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Aug 2026
Category Modules Front End
avatar richard67
richard67 - comment - 27 Aug 2026

@mmustafasenoglu When you have created this PR, our pull request template prepared the description of the PR. Unfortunatelyx you have removed all of this.

We do not have pull request templates for nothing, and removing things from that template in your PR description is not really something a new contributor should do.

Normally, when I am new to something, e.g. a new member in a club, I would adapt to existing practice in that club and not try to change it on the first day I have joined.

So please add all back, check the checkbox of the Generative AI policy and provide testing instructions.

Thanks in advance.

avatar mmustafasenoglu mmustafasenoglu - change - 27 Aug 2026
The description was changed
avatar mmustafasenoglu mmustafasenoglu - edited - 27 Aug 2026
avatar richard67 richard67 - change - 5 Sep 2026
Title
fix(mod_articles_category): fix Chinese/multibyte character truncation
[5.4] Fix Chinese/multibyte character truncation in mod_articles_category
avatar richard67 richard67 - edited - 5 Sep 2026

Add a Comment

Login with GitHub to post a comment