better duplicate image detection for image enclosures

This commit is contained in:
Andrew Dolgov 2012-10-09 13:03:59 +04:00
parent 77bd9f3923
commit 1758f5a495

View File

@ -239,7 +239,9 @@ public class ArticleFragment extends Fragment {
URL url = new URL(a.content_url.trim());
String strUrl = url.toString().trim();
if (a.content_type.indexOf("image") != -1 /* && !articleContent.contains(strUrl) */) {
String regex = String.format("<img.*?src=[\"']%1$[\"']", strUrl);
if (a.content_type.indexOf("image") != -1 && !articleContent.matches(regex)) {
content += "<p><img src=\"" + strUrl.replace("\"", "\\\"") + "\"></p>";
}