Dbrant has uploaded a new change for review. https://gerrit.wikimedia.org/r/304233
Change subject: Fix long-pressing of links inside the WebView. ...................................................................... Fix long-pressing of links inside the WebView. I've noticed that long-pressing links was no longer working. This is because we've recently made a change that updates the base URL of the WebView dynamically, but then our long-press handler was expecting link URIs to have an authority that exactly matches "wikipedia.org", which would fail for language-specific domains, e.g. "en.wikipedia.org". This patch fixes the URI checking logic, and thus fixes the long-press handler. Change-Id: I48b0add7bcaf21ad4e4db705d5823502205c2eb5 --- M app/src/main/java/org/wikipedia/util/UriUtil.java 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia refs/changes/33/304233/1 diff --git a/app/src/main/java/org/wikipedia/util/UriUtil.java b/app/src/main/java/org/wikipedia/util/UriUtil.java index 0c4e38d..4157026 100644 --- a/app/src/main/java/org/wikipedia/util/UriUtil.java +++ b/app/src/main/java/org/wikipedia/util/UriUtil.java @@ -69,8 +69,10 @@ : url); } - public static boolean isValidPageLink(Uri uri) { - return ("wikipedia.org".equals(uri.getAuthority()) && !TextUtils.isEmpty(uri.getPath()) + public static boolean isValidPageLink(@NonNull Uri uri) { + return (!TextUtils.isEmpty(uri.getAuthority()) + && uri.getAuthority().endsWith("wikipedia.org") + && !TextUtils.isEmpty(uri.getPath()) && uri.getPath().startsWith("/wiki")); } -- To view, visit https://gerrit.wikimedia.org/r/304233 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I48b0add7bcaf21ad4e4db705d5823502205c2eb5 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