From c620d66ae21f1eae6d056c1530ce91a7ef2285c5 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 11 Jan 2023 17:09:47 +0300 Subject: Do not double escape search string --- src/main/java/com/juick/www/api/Messages.java | 4 ++-- src/main/java/com/juick/www/controllers/Site.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main/java/com/juick/www') diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java index c23976f4..e23356a4 100644 --- a/src/main/java/com/juick/www/api/Messages.java +++ b/src/main/java/com/juick/www/api/Messages.java @@ -104,7 +104,7 @@ public class Messages { } else if (daysback > 0) { mids = messagesService.getUserBlogAtDay(user.getUid(), 0, daysback); } else if (StringUtils.hasText(search)) { - mids = messagesService.getUserSearch(visitor, user.getUid(), WebUtils.encodeSphinx(search), 0, + mids = messagesService.getUserSearch(visitor, user.getUid(), search, 0, page); } else { mids = messagesService.getUserBlog(user.getUid(), 0, before); @@ -125,7 +125,7 @@ public class Messages { throw new HttpNotFoundException(); } } else if (StringUtils.hasText(search)) { - mids = messagesService.getSearch(visitor, WebUtils.encodeSphinx(search), page); + mids = messagesService.getSearch(visitor, search, page); } else { mids = messagesService.getAll(visitor.getUid(), before); } diff --git a/src/main/java/com/juick/www/controllers/Site.java b/src/main/java/com/juick/www/controllers/Site.java index 1169414f..3bf27772 100644 --- a/src/main/java/com/juick/www/controllers/Site.java +++ b/src/main/java/com/juick/www/controllers/Site.java @@ -150,7 +150,7 @@ public class Site { if (paramSearch != null) { String searchTitle = ResourceBundle.getBundle("messages", locale).getString("title.search"); title = searchTitle + StringEscapeUtils.escapeHtml4(paramSearch); - mids = messagesService.getSearch(visitor, WebUtils.encodeSphinx(paramSearch), page); + mids = messagesService.getSearch(visitor, paramSearch, page); } else if (paramShow == null) { title = ResourceBundle.getBundle("messages", locale).getString("link.discuss"); mids = messagesService.getDiscussions(visitor.getUid(), paramTo); @@ -266,7 +266,7 @@ public class Site { mids = messagesService.getUserTag(user.getUid(), paramTag.TID, privacy, before); } else if (paramSearch != null) { title = "Блог " + user.getName() + ": " + StringEscapeUtils.escapeHtml4(paramSearch); - mids = messagesService.getUserSearch(visitor, user.getUid(), WebUtils.encodeSphinx(paramSearch), + mids = messagesService.getUserSearch(visitor, user.getUid(), paramSearch, privacy, page); } else { title = "Блог " + user.getName(); -- cgit v1.2.3