Conversation
Use UTF-8-aware byte truncation for system tag names so multibyte characters are not split when names are limited to 64 bytes. Add regression coverage for creating, retrieving, and updating tags with multibyte names. Assisted-by: OpenCode:gpt-5.6-sol Signed-off-by: Hsukqi Lee <team@tsinbei.com>
Add regression coverage for reading and updating multibyte system tag names. Assisted-by: OpenCode:gpt-5.6-sol Signed-off-by: Hsukqi Lee <team@tsinbei.com>
c17de9a to
43442eb
Compare
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
|
||
| // Length of name column is 64 | ||
| $truncatedTagName = substr($tagName, 0, 64); | ||
| $truncatedTagName = mb_strcut($tagName, 0, 64, 'UTF-8'); |
There was a problem hiding this comment.
why mb_strcut and not mb_substr?
Summary
Fix system tag name truncation when a name contains multibyte UTF-8
characters and is longer than the database column limit.
The affected code previously used byte-based
substr(), which couldsplit a UTF-8 character and produce an invalid string. The affected
paths now use
mb_strcut()with explicit UTF-8 encoding.Fixes #63712
Tests
Command:
AI Disclosure
I used OpenCode with the gpt-5.6-sol model to assist with repository
research and implementation. I reviewed the resulting changes and
test coverage before submitting this pull request.