You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2016/12/21 08:40:58 UTC

[jira] [Commented] (JCR-3800) Text.escapeIllegalXpathSearchChars escapes only last character

    [ https://issues.apache.org/jira/browse/JCR-3800?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15766489#comment-15766489 ] 

Julian Reschke commented on JCR-3800:
-------------------------------------

[~c_koell] - do you recall *why* it only escapes the last character?

> 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.3.4#6332)