From d6ca0319bfc13c43617fc7b39ade97460575324a Mon Sep 17 00:00:00 2001 From: Ezerous Date: Sat, 16 Jun 2018 13:38:26 +0300 Subject: [PATCH] Hotfix (sanitizeTopicUrl) --- app/src/main/java/gr/thmmy/mthmmy/model/ThmmyPage.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/gr/thmmy/mthmmy/model/ThmmyPage.java b/app/src/main/java/gr/thmmy/mthmmy/model/ThmmyPage.java index 3478b618..aff0a38a 100644 --- a/app/src/main/java/gr/thmmy/mthmmy/model/ThmmyPage.java +++ b/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 * @return sanitized topic url */ public static String sanitizeTopicUrl(String topicUrl) { - Pattern pattern = Pattern.compile("http.*topic=\\d*\\.?\\d*"); - Matcher matcher = pattern.matcher(topicUrl); - if (matcher.find()) - return matcher.group(0); - return null; + return topicUrl.replace("action=printpage;","").replace("wap2",""); } }