bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Strip invalid characters in webchat client

RESOLVED FIXED in 1.1

Status

support.mozilla.org Graveyard
Chat
RESOLVED FIXED
9 years ago
6 years ago

People

(Reporter: zzxc, Assigned: zzxc)

Tracking

unspecified

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Assignee)

Description

9 years ago
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.
(Assignee)

Comment 1

9 years ago
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.
Attachment #377535 - Flags: review?(ozten.bugs)

Comment 2

9 years ago
Comment on attachment 377535 [details] [diff] [review]
One possible approach

Can you write a simple unit test which includes known bad characters?
(Assignee)

Comment 3

9 years ago
Created attachment 380039 [details] [diff] [review]
Better patch

This is a better approach, checking manually for invalid characters instead of using CharsetDecoder.
Attachment #377535 - Attachment is obsolete: true
Attachment #380039 - Flags: review?(ozten.bugs)
Attachment #377535 - Flags: review?(ozten.bugs)
(Assignee)

Comment 4

9 years ago
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 5

9 years ago
Comment on attachment 380039 [details] [diff] [review]
Better patch

I like this approach better too.
Attachment #380039 - Flags: review?(ozten.bugs) → review+
(Assignee)

Comment 6

9 years ago
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.