Commit a54b16e0 by 朱亚洁

bug处理

parent d0716392
......@@ -760,18 +760,22 @@ public class AdvertisingSpaceBizImpl implements AdvertisingSpaceBiz {
* @return
*/
private List<String> getLinkList(String title, Boolean isNew) {
//标题正则表达式
Pattern pa;
List<String> list = new ArrayList<>();
if (isNew) {
title = title.replaceAll("&nbsp;"," ");
pa = Pattern.compile(UrlConstant.OWN_SHORT_URL + "[0-9A-Za-z]+\\s");
String regex = "(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]";
Matcher matcher = Pattern.compile(regex, Pattern.DOTALL).matcher(title);
while (matcher.find()) {
String url = matcher.group();
if (url.startsWith(UrlConstant.OWN_SHORT_URL)) {
list.add(matcher.group());
}
}
} else {
pa = Pattern.compile("<link>.*?</link>");
}
List<String> list = new ArrayList<>();
Matcher ma = pa.matcher(title);
while (ma.find()) {
list.add(ma.group());
Pattern pa = Pattern.compile("<link>.*?</link>");
Matcher ma = pa.matcher(title);
while (ma.find()) {
list.add(ma.group());
}
}
return list;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment