[
https://issues.apache.org/jira/browse/JCR-3800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14103696#comment-14103696
]
Claus Köll commented on JCR-3800:
---------------------------------
It works as designed .. as you can read in the javadoc. It is also documented
in the comments of JCR-1248
> I added a helper Method in org.apache.jackrabbit.util.Text to escape illegal
> XPathChars.
>It checks illegal chars at the end of a XPatch search term
We can of course change the behaviour ..
> Text.escapeIllegalXpathSearchChars escapes only last character
> --------------------------------------------------------------
>
> Key: JCR-3800
> URL: https://issues.apache.org/jira/browse/JCR-3800
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-jcr-commons
> Affects Versions: 2.8
> Reporter: broman
>
> 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
--
This message was sent by Atlassian JIRA
(v6.2#6252)