-
-
Notifications
You must be signed in to change notification settings - Fork 53
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed
Description
Describe the bug
use the test:
func TestDefaultDriver_UTF8(t *testing.T) {
detector := goaway.NewProfanityDetector().WithCustomDictionary(
[]string{"anal", "あほ"}, // profanities
[]string{"あほほ"}, // falsePositives
[]string{"あほほし"}, // falseNegatives
)
message := "いい加減にしろ あほほし あほほ あほ anal ほ"
expected := "いい加減にしろ **** あほほ ** **** ほ"
isProfane := detector.IsProfane(message)
require.True(t, isProfane)
censored := detector.Censor(message)
require.Equal(t, expected, censored)
}
What do you see?
panic at:
github.com/TwiN/go-away.(*ProfanityDetector).Censor(0xc000082f08, {0xf8f7c7, 0x3c})
.../github.com/TwiN/go-away/goaway.go:193 +0x7a5
What do you expect to see?
UTF-8 filtered as well as ASCII
List the steps that must be taken to reproduce this issue
use the test from the description
Version
v1.6.9
Additional information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomershelp wantedExtra attention is neededExtra attention is needed