Uploaded image for project: 'Jackrabbit Content Repository'
  1. Jackrabbit Content Repository
  2. JCR-3800

Text.escapeIllegalXpathSearchChars escapes only last character

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.8
    • Fix Version/s: None
    • Component/s: jackrabbit-jcr-commons
    • Labels:
      None

      Description

      Escaping special characters by using Text.escapeIllegalXpathSearchChars works only on last special character.

      fullText = "Moving to Alabama? Start Off on the Left Foot!";
      println Text.escapeIllegalXpathSearchChars(fullText);

      Moving to Alabama? Start Off on the Left Foot!

      fullText = "Moving to Alabama! Start Off on the Left Foot!";
      println Text.escapeIllegalXpathSearchChars(fullText);

      Moving to Alabama! Start Off on the Left Foot!

      fullText = "Moving to Alabama! Start Off on the Left Foot?";
      println Text.escapeIllegalXpathSearchChars(fullText);
      Moving to Alabama! Start Off on the Left Foot?

      And such partially escaped string cannot be used in full text search in JCR it doesn't throw errors but also doesn't return any nodes

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                broman broman
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: