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

Text.escapeIllegalXpathSearchChars escapes only last character

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.8
    • None
    • jackrabbit-jcr-commons
    • 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

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

              Dates

                Created:
                Updated: