From 39d9e2fa59b99cc813caaef1a4173fff566c79bb Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Wed, 5 Feb 2020 00:57:28 +0100 Subject: [PATCH] URLs with uppercase letters trigger a search (#2735) --- .../shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java | 2 +- app/src/common/shared/org/mozilla/vrbrowser/utils/UrlUtils.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java index 81f5e1198..e35189e6e 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/views/NavigationURLBar.java @@ -372,7 +372,7 @@ public void handleURLEdit(String text) { GleanMetricsService.urlBarEvent(false); } - if (mSession.getCurrentUri() != url) { + if (!mSession.getCurrentUri().equals(url)) { mSession.loadUri(url); if (mDelegate != null) { diff --git a/app/src/common/shared/org/mozilla/vrbrowser/utils/UrlUtils.java b/app/src/common/shared/org/mozilla/vrbrowser/utils/UrlUtils.java index 9d05c00c7..166a339e8 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/utils/UrlUtils.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/utils/UrlUtils.java @@ -68,7 +68,7 @@ public static String stripProtocol(@Nullable String host) { return result; } - private static Pattern domainPattern = Pattern.compile("^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)?[a-z0-9]+([\\-\\.]{1}[a-z0-9]+)*\\.[a-z]{2,5}(:[0-9]{1,5})?(\\/.*)?$"); + private static Pattern domainPattern = Pattern.compile("^(http:\\/\\/www\\.|https:\\/\\/www\\.|http:\\/\\/|https:\\/\\/)?[a-zA-Z0-9]+([\\-\\.]{1}[a-zA-Z0-9]+)*\\.[a-zA-Z]{2,5}(:[0-9]{1,5})?(\\/.*)?$"); public static boolean isDomain(String text) { return domainPattern.matcher(text).find(); }