Description
JavascriptUtils.encodeString does not properly translate a single '\' backslash char into two "
" backslash characters in order to properly escape the Javascript string. The fix should be:
public static String encodeString(String string)
{
if (string == null)
StringBuffer sb = null; //create later on demand
String app;
char c;
for (int i = 0; i < string.length (); ++i)
{
app = null;
c = string.charAt;
switch (c)
if (app != null)
{
if (sb == null)
sb.append(app);
} else {
if (sb != null)
}
}
if (sb == null)
{ return string; }else
{ return sb.toString(); }}