Jetty
  1. Jetty
  2. JETTY-1344

Quote function in org.mortbay.util.QuotedStringTokenizer will not unescape some special characters

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Incomplete
    • Affects Version/s: 6.1.25
    • Fix Version/s: None
    • Component/s: Servlet
    • Labels:
      None
    • Number of attachments :
      0

      Description

      In org.mortbay.util.QuotedStringTokenizer, the function unquote will unescape some characters (for example: u001e); but in function quote, these characters are not escaped. If we unquote a string, process it, and then quote this string, then output will get some unescaped characters, which is not what we expected.

        Activity

        Hide
        Greg Wilkins added a comment -

        Sorry I don't understand this issue.

        I added the following two tests to the QuotedStringTokenizerTest#testUnquote

        assertEquals("ab\u001ec",QuotedStringTokenizer.unquote("ab\u001ec"));
        assertEquals("ab\u001ec",QuotedStringTokenizer.unquote("\"ab\u001ec\""));

        both pass OK.

        Please reopen this issue if you have a concrete example.

        Show
        Greg Wilkins added a comment - Sorry I don't understand this issue. I added the following two tests to the QuotedStringTokenizerTest#testUnquote assertEquals("ab\u001ec",QuotedStringTokenizer.unquote("ab\u001ec")); assertEquals("ab\u001ec",QuotedStringTokenizer.unquote("\"ab\u001ec\"")); both pass OK. Please reopen this issue if you have a concrete example.

          People

          • Assignee:
            Unassigned
            Reporter:
            george sun
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: