3764: Diff upload bug on Firefox with special file names

maxime*******@smil**** (Google Code) (Is this you? Claim this profile.)
What version are you running?
2.0.11

What's the URL of the page containing the problem?
rb/r/new/

What steps will reproduce the problem?
1. Use Firefox
2. Select a diff file (with a "special" name, see below) to upload
3. Fill in a base directory
4. Submit

What is the expected output? What do you see instead?
Expected: diff file uploaded
Seen: No upload and "Unknown error" message

What operating system are you using? What browser?
Linux / Firefox 35

Please provide any additional information below.
The problem occurs on Firefox (not on Chrome).
On Firefox, no HTTP request is sent (seen on Firebug network tab): the error occurs before the ajax call.
The file name (in our test: "Anomalie_#331845__[inbound]_–_[TNF]_–[Return_confirmation_email]_-_Formatting.patch") seems to be the problem.

After some JS debugging, I've discovered in the "_onValidateError" function that xhr.statusText="InvalidCharacterError: String contains an invalid character".
I suspect one of the special characters of the file name to be the problem.
The solution should be to sanitize the file name before the ajax call.