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

Fix null byte sanitisation #78

Merged
merged 2 commits into from
Aug 28, 2023

Conversation

smadeja
Copy link
Contributor

@smadeja smadeja commented Aug 28, 2023

Trying to sanitise input containing both invalid UTF-8 characters and null bytes will currently raise ArgumentError: invalid byte sequence in UTF-8 when the newly introduced sanitize_null_bytes option is set to true. The reason for that is that the optional null byte sanitisation happens before forcing UTF-8 encoding. This fixes that by making sure character sanitisation is performed first in both the default strategies

@whitequark whitequark merged commit 0fd3640 into whitequark:master Aug 28, 2023
10 checks passed
@amitsaxena
Copy link

@whitequark do you follow some release schedule or can we possibly have a newer version of the gem released with this fix?

@whitequark
Copy link
Owner

No schedule. I'll make a release.

@whitequark
Copy link
Owner

1.9.1

@amitsaxena
Copy link

Thanks a lot @whitequark! ⭐

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.

3 participants