Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
URLs with uppercase letters trigger a search (#2735)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored Feb 4, 2020
1 parent 9bab9b9 commit 39d9e2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 39d9e2f

Please sign in to comment.