From 27832f1a0081ef423342a3162ce8ed5f0be66d82 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 26 Oct 2017 11:54:56 -0400 Subject: Fix/url parsing (#448) * Fix url formatting * Optimize imports --- app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt | 1 + 1 file changed, 1 insertion(+) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt index 4db75fff..22fc275f 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt @@ -31,6 +31,7 @@ class FbUrlFormatter(url: String) { var cleanedUrl = url discardable.forEach { cleanedUrl = cleanedUrl.replace(it, "", true) } converter.forEach { (k, v) -> cleanedUrl = cleanedUrl.replace(k, v, true) } + if (cleanedUrl != url) cleanedUrl = cleanedUrl.replaceFirst("&", "?") cleanedUrl = URLDecoder.decode(cleanedUrl, StandardCharsets.UTF_8.name()) val qm = cleanedUrl.indexOf("?") if (qm > -1) { -- cgit v1.2.3