Wicket
  1. Wicket
  2. WICKET-3766

Strings#escapeMarkup() creates invalid XML for control characters

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.17
    • Fix Version/s: 1.4.18
    • Component/s: wicket
    • Labels:

      Description

      Most C0 control characters are invalid in XML:

      http://en.wikipedia.org/wiki/Valid_characters_in_XML

      Besides 0x09, 0x0a and 0x0d all other control characters below 0x20 have to be escaped, see attached patch.

      Currently model objects containing these characters and being rendered (e.g. via labels) will lead to Ajax response failures.

        Activity

        Hide
        Sven Meier added a comment -

        Sorry, I wasn't aware of this change in 1.5. Please backport it to 1.4.x.

        BTW the encoding is a little too strict: 0x09, 0x0a and 0x0d need not to be encoded. IMHO it would be nicer to humans to read the markup if they stayed like they are, i.e. not encoded.

        Show
        Sven Meier added a comment - Sorry, I wasn't aware of this change in 1.5. Please backport it to 1.4.x. BTW the encoding is a little too strict: 0x09, 0x0a and 0x0d need not to be encoded. IMHO it would be nicer to humans to read the markup if they stayed like they are, i.e. not encoded.
        Hide
        Sven Meier added a comment -

        Sorry, I wasn't aware of this change in 1.5. Please backport it to 1.4.x.

        BTW the encoding is a little too strict: 0x09, 0x0a and 0x0d need not to be encoded. IMHO it would be nicer to humans to read the markup if they stayed like they are, i.e. not encoded.

        Show
        Sven Meier added a comment - Sorry, I wasn't aware of this change in 1.5. Please backport it to 1.4.x. BTW the encoding is a little too strict: 0x09, 0x0a and 0x0d need not to be encoded. IMHO it would be nicer to humans to read the markup if they stayed like they are, i.e. not encoded.
        Hide
        Martin Grigorov added a comment -

        This is fixed in trunk several months ago. It wasn't ported to 1.4.x to not compromise its stability. I guess it proved to be stable and can be ported now.

        Show
        Martin Grigorov added a comment - This is fixed in trunk several months ago. It wasn't ported to 1.4.x to not compromise its stability. I guess it proved to be stable and can be ported now.
        Hide
        Sven Meier added a comment -

        escaping control characters

        Show
        Sven Meier added a comment - escaping control characters

          People

          • Assignee:
            Martin Grigorov
            Reporter:
            Sven Meier
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development