We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
git-bug/util/text/validate.go
Lines 19 to 34 in 1212f75
doesn't check for invalid UTF-8, so this string would be returned as safe:
"\xA0\xA1"
also doesn't catch all control characters, so this would also be returned as safe:
"\u200E"
improved code:
package unicode import ( "unicode" "unicode/utf8" ) func binary(src []byte) bool { for len(src) >= 1 { r, size := utf8.DecodeRune(src) if r == utf8.RuneError { if size == 1 { return true } } if unicode.Is(unicode.C, r) { return true } src = src[size:] } return false }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
git-bug/util/text/validate.go
Lines 19 to 34 in 1212f75
doesn't check for invalid UTF-8, so this string would be returned as safe:
also doesn't catch all control characters, so this would also be returned as safe:
improved code:
The text was updated successfully, but these errors were encountered: