aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-10-26 11:54:56 -0400
committerGitHub <noreply@github.com>2017-10-26 11:54:56 -0400
commit27832f1a0081ef423342a3162ce8ed5f0be66d82 (patch)
tree757e47446bd438bd7a600a41c0911391cc433bc6 /app/src/main/kotlin
parentf3c14a1e5591f9d244c73bc0e53a6e042f5b9a06 (diff)
downloadfrost-27832f1a0081ef423342a3162ce8ed5f0be66d82.tar.gz
frost-27832f1a0081ef423342a3162ce8ed5f0be66d82.tar.bz2
frost-27832f1a0081ef423342a3162ce8ed5f0be66d82.zip
Fix/url parsing (#448)
* Fix url formatting * Optimize imports
Diffstat (limited to 'app/src/main/kotlin')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt1
1 files changed, 1 insertions, 0 deletions
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) {