Browse Source

Hotfix (sanitizeTopicUrl)

pull/24/head
Ezerous 7 years ago
parent
commit
d6ca0319bf
No known key found for this signature in database GPG Key ID: 262B2954BBA319E3
  1. 9
      app/src/main/java/gr/thmmy/mthmmy/model/ThmmyPage.java

9
app/src/main/java/gr/thmmy/mthmmy/model/ThmmyPage.java

@ -191,16 +191,11 @@ public class ThmmyPage {
} }
/** /**
* This method gets a VALID topic url and strips any unnecessary stuff (like e.g. wap2) * This method gets a VALID topic url and strips it off any unnecessary stuff (e.g. wap2).
*
* @param topicUrl a valid topic url * @param topicUrl a valid topic url
* @return sanitized topic url * @return sanitized topic url
*/ */
public static String sanitizeTopicUrl(String topicUrl) { public static String sanitizeTopicUrl(String topicUrl) {
Pattern pattern = Pattern.compile("http.*topic=\\d*\\.?\\d*"); return topicUrl.replace("action=printpage;","").replace("wap2","");
Matcher matcher = pattern.matcher(topicUrl);
if (matcher.find())
return matcher.group(0);
return null;
} }
} }

Loading…
Cancel
Save