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

Fixes #2718 URLs with uppercase letters trigger a search #2735

Merged
merged 1 commit into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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