Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Truncation should handle UTF-8 (multi-byte encoding) #2769

Closed
anonymous-piwik-user opened this Issue · 10 comments

3 participants

Anonymous Piwik user Anthon Pang Matthieu Aubry
Anonymous Piwik user

This patch fixes a bug in the 'truncate' function (core function) where PHP function 'substr' have been working incorrectly with the 'utf-8' Cyrillic encoding.

That was causing the '' symbol appearing in the end of page titles being cut. For example, we found the bug in 'Visitors' > 'Visitor Log' section.

So the patch replaces the 'substr' fucntion with the 'mb_substr' and 'utf-8' and the bug then goes away.

Anthon Pang
Collaborator

thanks; the only change to the patch would be to handle case where mbstring extension may not be present

Anthon Pang
Collaborator

(In [5427]) fixes #2769

Matthieu Aubry
Owner

codax thanks for the patch, and vipsoft thanks for super fast commit ;)

Anonymous Piwik user

Attachment: encode patch for mbstrings
truncate.2.patch

Anthon Pang
Collaborator

(In [5430]) refs #2769 - revert this patch

Anthon Pang
Collaborator

(In [5431]) fixes #2769 plus refactoring

Matthieu Aubry
Owner

codax, do you mind testing the new versions of the modified files and confirm it is working for your encoded strings?

Anonymous Piwik user

Replying to matt:

codax, do you mind testing the new versions of the modified files and confirm it is working for your encoded strings?

Thanks for the feedback. We have tested things and now it's working fine.

Anonymous Piwik user anonymous-piwik-user added this to the 1.7 Piwik 1.7 milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.