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

Improved user text input sanitisation and extended supported chars in DB #122

Merged
merged 5 commits into from
Jun 13, 2024

Conversation

zefir-git
Copy link
Member

@zefir-git zefir-git commented Jun 13, 2024

Alters table columns to change the collation from latin1_general to utf8mb3_general to enable the use of foreign languages.

Validates that strings a user provides for such columns do not exceed codepoint 0xFFFF which is the maximum supported by utf8mb3. Additional characters can be excluded with configurable RegEx:

# Advanced: do not edit unless you have good understanding of RegEx
# Regular expression for disallowed characters user-provided text inputs
# e.g. account name, transaction description, POS description, invoice description
# Note: additionally <> and characters with code point above 0xFFFF are always disallowed.
disallowed-regex: [\x00-\x08\x0B-\x1F\x7F-\x9F\u2400-\u2421\u200B-\u200D\uFEFF\uD800-\uDB7F\uDFFF]

Descriptions that exceed the column string length limit will be cut and (a single character) will be appended. This should prevent DB errors while also indicating to users that the description was cut short.

@zefir-git zefir-git added the bug Something isn't working label Jun 13, 2024
@zefir-git zefir-git self-assigned this Jun 13, 2024
@zefir-git zefir-git linked an issue Jun 13, 2024 that may be closed by this pull request
@zefir-git
Copy link
Member Author

zefir-git commented Jun 13, 2024

image
image
image
image

@zefir-git zefir-git force-pushed the 121-russian-translation-cyrillic-support branch from 66dc461 to 4cc1496 Compare June 13, 2024 12:41
@zefir-git zefir-git force-pushed the 121-russian-translation-cyrillic-support branch from 4cc1496 to 308dfcc Compare June 13, 2024 12:42
@zefir-git zefir-git marked this pull request as ready for review June 13, 2024 12:43
@zefir-git zefir-git requested a review from a team June 13, 2024 12:44
@zefir-git zefir-git changed the title Use more permissive DB collation for user inputted string fields (i.e. names & descriptions) Improved user text input sanitisation and extended supported chars in DB Jun 13, 2024
@zefir-git zefir-git added the enhancement Improvement of existing feature label Jun 13, 2024
Copy link
Member

@Dviih Dviih left a comment

Choose a reason for hiding this comment

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

Everything seems good to me

@zefir-git zefir-git merged commit 5912e2e into master Jun 13, 2024
3 checks passed
@zefir-git zefir-git deleted the 121-russian-translation-cyrillic-support branch June 13, 2024 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement Improvement of existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Russian Translation, Cyrillic Support
2 participants