Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
anonymous-matomo-user opened this issue Nov 10, 2011 · 10 comments
Closed

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

anonymous-matomo-user opened this issue Nov 10, 2011 · 10 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Milestone

Comments

@anonymous-matomo-user
Copy link

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.

@anonymous-matomo-user
Copy link
Author

Attachment:
truncate.patch

@robocoder
Copy link
Contributor

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

@robocoder
Copy link
Contributor

(In [5427]) fixes #2769

@mattab
Copy link
Member

mattab commented Nov 11, 2011

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

@anonymous-matomo-user
Copy link
Author

Attachment: encode patch for mbstrings
truncate.2.patch

@anonymous-matomo-user
Copy link
Author

Attachment:
mbstringsDetectEncode.patch

@robocoder
Copy link
Contributor

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

@robocoder
Copy link
Contributor

(In [5431]) fixes #2769 plus refactoring

@mattab
Copy link
Member

mattab commented Nov 13, 2011

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

@anonymous-matomo-user
Copy link
Author

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.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical.
Projects
None yet
Development

No branches or pull requests

3 participants