From c5e769deabeb80d7257b85c5c3d802cf46e6b191 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 13 Apr 2018 00:13:28 -0400 Subject: Fix view full image (#882) * Test including full photo viewer * Test cookie in glide * Fix parser and add redirects to view full image * Update changelog --- app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt') 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 f21c03e9..add35154 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbUrlFormatter.kt @@ -43,6 +43,7 @@ class FbUrlFormatter(url: String) { L.e(e) { "Failed url formatting" } return url } + cleanedUrl = cleanedUrl.replace("&", "&") if (changed && !cleanedUrl.contains("?")) //ensure we aren't missing '?' cleanedUrl = cleanedUrl.replaceFirst("&", "?") val qm = cleanedUrl.indexOf("?") @@ -54,8 +55,6 @@ class FbUrlFormatter(url: String) { cleanedUrl = cleanedUrl.substring(0, qm) } discardableQueries.forEach { queries.remove(it) } - //final cleanup - misc.forEach { (k, v) -> cleanedUrl = cleanedUrl.replace(k, v, true) } if (cleanedUrl.startsWith("/")) cleanedUrl = FB_URL_BASE + cleanedUrl.substring(1) cleanedUrl = cleanedUrl.replaceFirst(".facebook.com//", ".facebook.com/") //sometimes we are given a bad url L.v { "Formatted url from $url to $cleanedUrl" } @@ -101,8 +100,6 @@ class FbUrlFormatter(url: String) { VIDEO_REDIRECT ) - val misc = arrayOf("&" to "&") - val discardableQueries = arrayOf("ref", "refid", "acontext", "SharedWith") val converter = listOf( -- cgit v1.2.3