admin
2019-08-13 37194e2d4b4ab85f7f29c1e900c406afe294579a
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -123,10 +123,7 @@
      // 去除前后空格
      text = text.trim();
      if (text.length() > 256) {
         out.print(JsonUtil.loadFalseResult("值过长"));
         return;
      }
      TaoBaoGoodsBrief tb = null;
      String URL_REGEX = "(((http|https)://)|(www\\.))[a-zA-Z0-9\\._-]+\\.[a-zA-Z]{2,6}(:[0-9]{1,4})?(/[a-zA-Z0-9\\&%_\\./-~-]*)?";
@@ -134,8 +131,12 @@
      Pattern p = Pattern.compile(URL_REGEX);
      Matcher matcher = p.matcher(text);
      if (!matcher.find()) {// 不包含链接
         if (text.length() > 256) {
            out.print(JsonUtil.loadFalseResult("值过长"));
            return;
         }
         String pattern = "^[A-Za-z0-9-]+$";
         if (Pattern.matches(pattern, text)) {
         if (Pattern.matches(pattern, text.replace(" ", ""))) {//删除空格
            out.println(JsonUtil.loadFalseResult("不支持推荐"));
            return;
         }