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

prevent inserting truncated UTF-8 into motto field #1789

Merged
merged 3 commits into from
Aug 23, 2023

Conversation

Jamiras
Copy link
Member

@Jamiras Jamiras commented Aug 23, 2023

Reccurrance of:

Error encoding model [App\\Site\\Models\\User] with ID  to JSON: Malformed UTF-8 characters, possibly incorrectly encoded 
at /home/forge/retroachievements.org/releases/2023-08-14T082503-3.2.2-83eca4ee/vendor/laravel/framework/src/Illuminate/Database/Eloquent/JsonEncodingException.php:18)

Which was originally reported here.

This sanitizes the motto going into the database so the error shouldn't occur again in the future.

Copy link
Member

@wescopeland wescopeland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally the the mb_strcut() call is working correctly. I did not verify the other change, but I understand what it's doing and agree it's desirable.

@Jamiras Jamiras merged commit c1330cd into RetroAchievements:master Aug 23, 2023
5 checks passed
@Jamiras Jamiras deleted the truncated_motto branch August 23, 2023 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants