문자전송, 선거문자 하단 문자샘플, 그림샘플, 내문자함 검색어 입력 특수문자 입력 금지 기능 추가 - 기존 헤더부분 통합검색에만 적용되었던 기능을 확대 적용하였음.
- 기존 헤더부분 통합검색에만 적용되었던 기능을 확대 적용하였음.
@3d8054fa83f98f9d64babdf3314e55272c740784
--- src/main/java/itn/com/cmm/util/StringUtil.java
+++ src/main/java/itn/com/cmm/util/StringUtil.java
... | ... | @@ -578,4 +578,26 @@ |
| 578 | 578 |
return ntceEndde; |
| 579 | 579 |
} |
| 580 | 580 |
|
| 581 |
+ /* |
|
| 582 |
+ * 검색 키워드 내용에 한글, 영문, 숫자를 제외한 특수문자가 있는 경우 검색이 안되도록 처리 |
|
| 583 |
+ * |
|
| 584 |
+ * |
|
| 585 |
+ * */ |
|
| 586 |
+ public static boolean getSearchKeywordValidation(String paramKeyword) {
|
|
| 587 |
+ |
|
| 588 |
+ boolean resultType = false; |
|
| 589 |
+ String keyword = paramKeyword; |
|
| 590 |
+ |
|
| 591 |
+ keyword = keyword.replaceAll("[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9 ]", "");
|
|
| 592 |
+ |
|
| 593 |
+ //검색어에 특수기호가 없어서 공백이 되는 경우만 true를 리턴한다. |
|
| 594 |
+ if(keyword.equals("")) {
|
|
| 595 |
+ |
|
| 596 |
+ resultType = true; |
|
| 597 |
+ } |
|
| 598 |
+ |
|
| 599 |
+ return resultType; |
|
| 600 |
+ |
|
| 601 |
+ } |
|
| 602 |
+ |
|
| 581 | 603 |
}(No newline at end of file) |
--- src/main/java/itn/let/mjo/msgcampain/web/MjonMsgCampainDataController.java
+++ src/main/java/itn/let/mjo/msgcampain/web/MjonMsgCampainDataController.java
... | ... | @@ -1201,6 +1201,18 @@ |
| 1201 | 1201 |
RedirectAttributes redirectAttributes) throws Exception {
|
| 1202 | 1202 |
|
| 1203 | 1203 |
|
| 1204 |
+ //검색 키워드 체크 기능 추가 |
|
| 1205 |
+ String keyword = letterVO.getSearchKeyword(); |
|
| 1206 |
+ boolean searchKeyType = StringUtil.getSearchKeywordValidation(keyword); |
|
| 1207 |
+ |
|
| 1208 |
+ if(!searchKeyType) {//검색 결과 Null로 리턴함.
|
|
| 1209 |
+ |
|
| 1210 |
+ List<?> exceptionLetterList = new ArrayList<>(); |
|
| 1211 |
+ |
|
| 1212 |
+ model.addAttribute("resultLetterList", exceptionLetterList);
|
|
| 1213 |
+ return "web/msgcampain/LetterListAjax"; |
|
| 1214 |
+ } |
|
| 1215 |
+ |
|
| 1204 | 1216 |
CateCode cateCode = new CateCode(); |
| 1205 | 1217 |
cateCode.setCateNo(letterVO.getCategoryCode()); |
| 1206 | 1218 |
CateCode cateCodeInfoVO = cmmnDetailCodeManageService.selectCateCodeInfo(cateCode); //카테고리 상세 조회 |
... | ... | @@ -1340,6 +1352,18 @@ |
| 1340 | 1352 |
SessionStatus status, |
| 1341 | 1353 |
RedirectAttributes redirectAttributes) throws Exception {
|
| 1342 | 1354 |
|
| 1355 |
+ |
|
| 1356 |
+ //검색 키워드 체크 기능 추가 |
|
| 1357 |
+ String keyword = letterVO.getSearchKeyword(); |
|
| 1358 |
+ boolean searchKeyType = StringUtil.getSearchKeywordValidation(keyword); |
|
| 1359 |
+ |
|
| 1360 |
+ if(!searchKeyType) {//검색 결과 Null로 리턴함.
|
|
| 1361 |
+ |
|
| 1362 |
+ List<?> exceptionPhoList = new ArrayList<>(); |
|
| 1363 |
+ |
|
| 1364 |
+ model.addAttribute("resultPhoList", exceptionPhoList);
|
|
| 1365 |
+ return "web/msgcampain/PhotoListAjax"; |
|
| 1366 |
+ } |
|
| 1343 | 1367 |
|
| 1344 | 1368 |
CateCode cateCode = new CateCode(); |
| 1345 | 1369 |
cateCode.setCateNo(letterVO.getCategoryCode()); |
... | ... | @@ -1555,6 +1579,19 @@ |
| 1555 | 1579 |
|
| 1556 | 1580 |
mjonMsgDataVO.setUserId(userId); |
| 1557 | 1581 |
|
| 1582 |
+ |
|
| 1583 |
+ //검색 키워드 체크 기능 추가 |
|
| 1584 |
+ String keyword = mjonMsgDataVO.getSearchKeyword(); |
|
| 1585 |
+ boolean searchKeyType = StringUtil.getSearchKeywordValidation(keyword); |
|
| 1586 |
+ |
|
| 1587 |
+ if(!searchKeyType) {//검색 결과 Null로 리턴함.
|
|
| 1588 |
+ |
|
| 1589 |
+ List<?> exceptionMyMsgList = new ArrayList<>(); |
|
| 1590 |
+ |
|
| 1591 |
+ model.addAttribute("resultMyMsgList", exceptionMyMsgList);
|
|
| 1592 |
+ return "web/msgcampain/MyMsgListAjax"; |
|
| 1593 |
+ } |
|
| 1594 |
+ |
|
| 1558 | 1595 |
//그림 문자 리스트 불러오기 |
| 1559 | 1596 |
//LetterVO letterVO = new LetterVO(); |
| 1560 | 1597 |
if(mjonMsgDataVO.getPageUnit() != 10) {
|
--- src/main/java/itn/let/mjo/msgdata/web/MjonMsgDataController.java
+++ src/main/java/itn/let/mjo/msgdata/web/MjonMsgDataController.java
... | ... | @@ -1131,6 +1131,20 @@ |
| 1131 | 1131 |
SessionStatus status, |
| 1132 | 1132 |
RedirectAttributes redirectAttributes) throws Exception {
|
| 1133 | 1133 |
|
| 1134 |
+ |
|
| 1135 |
+ //검색 키워드 체크 기능 추가 |
|
| 1136 |
+ String keyword = letterVO.getSearchKeyword(); |
|
| 1137 |
+ boolean searchKeyType = StringUtil.getSearchKeywordValidation(keyword); |
|
| 1138 |
+ |
|
| 1139 |
+ if(!searchKeyType) {//검색 결과 Null로 리턴함.
|
|
| 1140 |
+ |
|
| 1141 |
+ List<?> exceptionLetterList = new ArrayList<>(); |
|
| 1142 |
+ |
|
| 1143 |
+ model.addAttribute("resultLetterList", exceptionLetterList);
|
|
| 1144 |
+ return "web/msgdata/LetterListAjax"; |
|
| 1145 |
+ } |
|
| 1146 |
+ |
|
| 1147 |
+ |
|
| 1134 | 1148 |
CateCode cateCode = new CateCode(); |
| 1135 | 1149 |
cateCode.setCateNo(letterVO.getCategoryCode()); |
| 1136 | 1150 |
CateCode cateCodeInfoVO = cmmnDetailCodeManageService.selectCateCodeInfo(cateCode); //카테고리 상세 조회 |
... | ... | @@ -1302,6 +1316,18 @@ |
| 1302 | 1316 |
} else if(subStr.equals("") && !letterVO.getUpperCateNo().equals("")) { //하위분류에서 전체 클릭 시 중분류의 코드로 문자샘플 조회
|
| 1303 | 1317 |
letterVO.setCategoryCode(letterVO.getUpperCateNo().substring(0, 3)); |
| 1304 | 1318 |
}*/ |
| 1319 |
+ |
|
| 1320 |
+ //검색 키워드 체크 기능 추가 |
|
| 1321 |
+ String keyword = letterVO.getSearchKeyword(); |
|
| 1322 |
+ boolean searchKeyType = StringUtil.getSearchKeywordValidation(keyword); |
|
| 1323 |
+ |
|
| 1324 |
+ if(!searchKeyType) {//검색 결과 Null로 리턴함.
|
|
| 1325 |
+ |
|
| 1326 |
+ List<?> exceptionPhoList = new ArrayList<>(); |
|
| 1327 |
+ |
|
| 1328 |
+ model.addAttribute("resultPhoList", exceptionPhoList);
|
|
| 1329 |
+ return "web/msgdata/PhotoListAjax"; |
|
| 1330 |
+ } |
|
| 1305 | 1331 |
|
| 1306 | 1332 |
CateCode cateCode = new CateCode(); |
| 1307 | 1333 |
cateCode.setCateNo(letterVO.getCategoryCode()); |
... | ... | @@ -1528,6 +1554,20 @@ |
| 1528 | 1554 |
if(loginVO == null) {
|
| 1529 | 1555 |
return "redirect:/web/main/mainPage.do"; |
| 1530 | 1556 |
} |
| 1557 |
+ |
|
| 1558 |
+ |
|
| 1559 |
+ //검색 키워드 체크 기능 추가 |
|
| 1560 |
+ String keyword = mjonMsgDataVO.getSearchKeyword(); |
|
| 1561 |
+ boolean searchKeyType = StringUtil.getSearchKeywordValidation(keyword); |
|
| 1562 |
+ |
|
| 1563 |
+ if(!searchKeyType) {//검색 결과 Null로 리턴함.
|
|
| 1564 |
+ |
|
| 1565 |
+ List<?> exceptionMyMsgList = new ArrayList<>(); |
|
| 1566 |
+ |
|
| 1567 |
+ model.addAttribute("resultPhoList", exceptionMyMsgList);
|
|
| 1568 |
+ return "web/msgdata/MyMsgListAjax"; |
|
| 1569 |
+ } |
|
| 1570 |
+ |
|
| 1531 | 1571 |
|
| 1532 | 1572 |
mjonMsgDataVO.setUserId(userId); |
| 1533 | 1573 |
|
... | ... | @@ -5064,14 +5104,15 @@ |
| 5064 | 5104 |
* 2023-04-24 우영두 |
| 5065 | 5105 |
* |
| 5066 | 5106 |
* */ |
| 5067 |
- String keyword = mjonMsgDataVO.getSearchKeyword(); |
|
| 5068 |
- keyword = keyword.replaceAll("[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9 ]", "");
|
|
| 5069 | 5107 |
|
| 5070 |
- if(!keyword.equals("")) {
|
|
| 5108 |
+ String keyword = mjonMsgDataVO.getSearchKeyword(); |
|
| 5109 |
+ boolean searchKeyType = StringUtil.getSearchKeywordValidation(keyword); |
|
| 5110 |
+ |
|
| 5111 |
+ if(!searchKeyType) {
|
|
| 5071 | 5112 |
|
| 5072 | 5113 |
modelAndView.addObject("status", "wordFail");
|
| 5073 | 5114 |
modelAndView.addObject("message", "잘못된 검색어 입니다.");
|
| 5074 |
- return modelAndView; |
|
| 5115 |
+ return modelAndView; |
|
| 5075 | 5116 |
} |
| 5076 | 5117 |
|
| 5077 | 5118 |
//욕설 및 금지 단어 리스트 불러오기 |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?