This is an automated email from the ASF dual-hosted git repository. ramyav pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/olingo-odata4.git
The following commit(s) were added to refs/heads/master by this push: new 7e1aa94 [OLINGO-1378] does not allow some special characters in search term 7e1aa94 is described below commit 7e1aa94d4e05540e2c183e912afbedb3501dc083 Author: ramya vasanth <ramya.vasa...@sap.com> AuthorDate: Fri Jul 17 10:31:50 2020 +0530 [OLINGO-1378] does not allow some special characters in search term --- .../server/core/uri/parser/search/SearchTokenizer.java | 18 +++++++++++++++--- .../core/uri/parser/search/SearchTokenizerTest.java | 4 +++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java index f89eca0..2afcfd0 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizer.java @@ -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 == '`'; } /** diff --git a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java index 47ac334..d8c6a7c 100644 --- a/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java +++ b/lib/server-core/src/test/java/org/apache/olingo/server/core/uri/parser/search/SearchTokenizerTest.java @@ -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