Please report any other irregularities here.
The webchat client currently allows users to send invalid, non-UTF8 characters in live chat, which can cause a disconnection. These should be filtered out before the message is sent.
Created attachment 377535 [details] [diff] [review] One possible approach This is one possible approach, using java.nio.charset.CharsetDecoder to process the input and ignore invalid characters.
Comment on attachment 377535 [details] [diff] [review] One possible approach Can you write a simple unit test which includes known bad characters?
Created attachment 380039 [details] [diff] [review] Better patch This is a better approach, checking manually for invalid characters instead of using CharsetDecoder.
Created attachment 380040 [details] Testcase This is a simple test class for the stripInvalid function in the previous patch. (The output of this class can be piped to iconv to verify that the processed output contains only valid UTF-8 characters)
Comment on attachment 380039 [details] [diff] [review] Better patch I like this approach better too.
Attachment #380039 - Flags: review?(ozten.bugs) → review+
Checked in r26451
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Component: Chat → Chat
Product: support.mozilla.org → support.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.