Dbrant has uploaded a new change for review. https://gerrit.wikimedia.org/r/159994
Change subject: Correctly urldecode links from Disambiguation dialog. ...................................................................... Correctly urldecode links from Disambiguation dialog. Bug: 70769 Change-Id: I58a2177915b533a2fa01c44041e6b80fc7bb5266 --- M wikipedia/src/main/java/org/wikipedia/page/LinkMovementMethodExt.java 1 file changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/94/159994/1 diff --git a/wikipedia/src/main/java/org/wikipedia/page/LinkMovementMethodExt.java b/wikipedia/src/main/java/org/wikipedia/page/LinkMovementMethodExt.java index 627d82f..87e3f10 100644 --- a/wikipedia/src/main/java/org/wikipedia/page/LinkMovementMethodExt.java +++ b/wikipedia/src/main/java/org/wikipedia/page/LinkMovementMethodExt.java @@ -6,6 +6,8 @@ import android.text.style.URLSpan; import android.view.MotionEvent; import android.widget.TextView; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; /** * Intercept web links and add special behavior for external links. @@ -28,9 +30,13 @@ final int off = layout.getOffsetForHorizontal(line, x); final URLSpan[] links = buffer.getSpans(off, off, URLSpan.class); if (links.length != 0) { - String url = links[0].getURL(); - handler.onUrlClick(url); - return true; + try { + String url = URLDecoder.decode(links[0].getURL(), "utf-8"); + handler.onUrlClick(url); + return true; + } catch (UnsupportedEncodingException e) { + // won't happen + } } } return super.onTouchEvent(widget, buffer, event); -- To view, visit https://gerrit.wikimedia.org/r/159994 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58a2177915b533a2fa01c44041e6b80fc7bb5266 Gerrit-PatchSet: 1 Gerrit-Project: apps/android/wikipedia Gerrit-Branch: master Gerrit-Owner: Dbrant <dbr...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits