We have a lot of problems with source tracking \ u2028 (line separator) in user data that cause the "unterminated string literal" error in Firefox.
As a result, we are trying to filter it before sending it to the server (and then to the database).
After an extensive googling search and reading by other people, it is clear that I have to filter out these characters before sending them to the database.
Before writing a filter, I tried to find a character to make sure that he can find it using:
var index = content.search("/\u2028/");
alert("Index: [" + index + "]");
I get -1 as a result every time, even when I know that the character is in the content variable (I confirmed with the jUnit Java test on the server side).
Assuming content.replace () will work just like search (), is there something I'm doing wrong or something that I'm missing to find and break these line breaks?
source
share