Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-2458

JavascriptUtils.escapeQuotes() misses escaping double quotes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.4.1
    • 1.4.2, 1.5-M1
    • wicket
    • None

    Description

      The JavaDoc for org.apache.wicket.util.string.JavascriptUtils.escapeQuotes(CharSequence) states:
      "Escape quotes and double quotes so that they can be part of e.g. an alert call."

      But the actual implementation only escapes quotes:

      CharSequence s = input;
      if (s != null)
      {
      s = Strings.replaceAll(s, "'", "
      '");
      }
      return s;

      Either the javadoc must be amended or the implementation must also escape double quotes which probably would be the better choice as alerts can both specified using single or double quotes.

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            tapter Matthias Keller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: