Bug 1035131 - Decode user entered URLs to exclude from suggested sites (r=mfinkle)
This commit is contained in:
@@ -11,6 +11,7 @@ import android.text.TextUtils;
|
||||
public class StringUtils {
|
||||
|
||||
private static final String FILTER_URL_PREFIX = "filter://";
|
||||
private static final String USER_ENTERED_URL_PREFIX = "user-entered:";
|
||||
|
||||
/*
|
||||
* This method tries to guess if the given string could be a search query or URL,
|
||||
@@ -161,6 +162,10 @@ public class StringUtils {
|
||||
"file".equals(scheme) || "resource".equals(scheme));
|
||||
}
|
||||
|
||||
public static boolean isUserEnteredUrl(String url) {
|
||||
return (url != null && url.startsWith(USER_ENTERED_URL_PREFIX));
|
||||
}
|
||||
|
||||
/**
|
||||
* Given a url with a user-entered scheme, extract the
|
||||
* scheme-specific component. For e.g, given "user-entered://www.google.com",
|
||||
|
||||
Reference in New Issue
Block a user