-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Trim to 255 runes instead of bytes #12150
Trim to 255 runes instead of bytes #12150
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import is missing
Prevents invalid UTF-8 encoding for Description and Website. Refs go-gitea#7905
eab1d13
to
83550d1
Compare
Ups. Forgot to stage the import. I just amended the commit |
Co-authored-by: zeripath <art27@cantab.net>
So we also need to adjust the database column size. |
255 is still below the current limits:
|
I don't know why we need to trim the content to 255 runes since it could hold 65535 bytes? |
I also didn't knew. I just wanted to change as little as possible to avoid breaking other parts. Actually according to the DB-schema it's 65536 Codepoints/Runes not bytes. |
🚀 |
Please send backport |
* Trim to 255 runes instead of bytes Prevents invalid UTF-8 encoding for Description and Website. Refs #7905 * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
* Trim to 255 runes instead of bytes Prevents invalid UTF-8 encoding for Description and Website. Refs go-gitea#7905 * Apply suggestions from code review Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: techknowlogick <matti@mdranta.net> Co-authored-by: zeripath <art27@cantab.net> Co-authored-by: Lauris BH <lauris@nix.lv>
Prevents invalid UTF-8 encoding for Description and Website. Refs #7905
Prevents Internal Server errors when repo is created with description > 255 bytes, for example 160*ü (320 bytes):
üüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüüü