admin
2019-08-16 c9a4a9cdc559d0f28edee94f2e2c865bfab609c4
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,6 +131,10 @@
      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.replace(" ", ""))) {//删除空格
            out.println(JsonUtil.loadFalseResult("不支持推荐"));