Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1957

Local name escaping does not properly encode whitespace characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Blocker Blocker
    • 3.4.0.Final
    • 3.3.0.Final
    • Common, JCR
    • None

      ModeShape's Jsr283Encoder class does not properly escape the whitespace characters:

      Section 3.2.2 of JSR-283 defines a local name as follows:

      LocalName ::= ValidString - SelfOrParent
      /* Any ValidString except SelfOrParent */
      SelfOrParent ::= '.' | '..'
      ValidString ::= ValidChar {ValidChar}
      ValidChar ::= XmlChar - InvalidChar
      /* Any XmlChar except InvalidChar */
      InvalidChar ::= '/' | ':' | '[' | ']' | '|' | '*'
      XmlChar ::= /* Any character that matches the Char production at http://www.w3.org/TR/xml/#NT-Char */
      

      where the Char production at http://www.w3.org/TR/xml/#NT-Char is as follows:

      Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]	/* any Unicode character, excluding the surrogate blocks, FFFE, and FFFF. */
      

      Note that #x9 is the tab character, #xA is the line feed character, #xD is the carriage return character, and #x20 is the space character.

      But ModeShape's Jsr283Encoder is not properly encoding/decoding the whitespace characters.

      We will need to address whether this fix will be backward compatible. If not, we may need to provide a switch/repository setting that allows someone to use the older (incorrect) encoding/decoding.

              rhauch Randall Hauch (Inactive)
              rhauch Randall Hauch (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: