[OLINGO-1378] does not allow some special characters in search term

This commit is contained in:
ramya vasanth 2020-07-17 10:31:50 +05:30
parent 6bc0fc72e6
commit 7e1aa94d4e
2 changed files with 18 additions and 4 deletions

View File

@ -123,8 +123,8 @@ public class SearchTokenizer {
|| isUnreserved(character)
|| isOtherDelimsForWord(character);
}
/**
/**
* <code>
* <b>searchPhrase</b> = quotation-mark 1*qchar-no-AMP-DQUOTE quotation-mark
* <br/><br/>
@ -218,7 +218,19 @@ public class SearchTokenizer {
|| character == '$'
|| character == '='
|| character == '%'
|| character == '\'';
|| character == '\''
|| character == '&'
|| character == '{'
|| character == '}'
|| character == '['
|| character == ']'
|| character == ','
|| character == '#'
|| character == '^'
|| character == '|'
|| character == '>'
|| character == '<'
|| character == '`';
}
/**

View File

@ -45,7 +45,9 @@ public class SearchTokenizerTest {
@Test
public void parseWords() throws Exception {
assertQuery("C++%20=$@:,*!/?'%27").resultsIn(WORD);
assertQuery("C++%20=$@:,*!/?'%27}#^.|").resultsIn(WORD);
assertQuery("[]|{`").resultsIn(WORD);
assertQuery(">").resultsIn(WORD);
assertQuery("somesimpleword").resultsIn(WORD);
assertQuery("anotherWord\u1234").resultsIn(WORD);
// special