Commit 6fffe3d7 by 高鹏

Merge branch 'zyj-1001413' into 'master'

bug处理

See merge request rays/pcloud-book!174
parents ebe91cd5 a54b16e0
......@@ -760,19 +760,23 @@ 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");
} else {
pa = Pattern.compile("<link>.*?</link>");
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());
}
List<String> list = new ArrayList<>();
}
} else {
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