it seems that wicket.util.string.Strings.escapeMarkup method does not escape " 
 and ', so when i input a " or ', the display is error.
 who can fix it? thanks.

  public static String escapeMarkup(final String s, final boolean escapeSpaces)
        {
                if (s == null)
                {
                        return null;
                }
                else
                {
                        final StringBuffer buffer = new StringBuffer();

                        for (int i = 0; i < s.length(); i++)
                        {
                                final char c = s.charAt(i);

                                switch (c)
                                {
                                        case '\t' :
                                                if (escapeSpaces)
                                                {
                                                        // Assumption is four 
space tabs (sorry, but that's
                                                        // just
                                                        // how it is!)
                                                        
buffer.append("&nbsp;&nbsp;&nbsp;&nbsp;");
                                                }
                                                else
                                                {
                                                        buffer.append(c);
                                                }
                                                break;

                                        case ' ' :
                                                if (escapeSpaces)
                                                {
                                                        buffer.append("&nbsp;");
                                                }
                                                else
                                                {
                                                        buffer.append(c);
                                                }
                                                break;

                                        case '<' :
                                                buffer.append("&lt;");
                                                break;

                                        case '>' :
                                                buffer.append("&gt;");
                                                break;

                                        default :
                                                buffer.append(c);
                                                break;
                                }
                        }

                        return buffer.toString();
                }
        }



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to