summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-09-06 10:21:29 -0700
committerJohn Reck <jreck@google.com>2011-09-06 10:21:29 -0700
commitfe5b94d91cc026aa5e8e9476ed77ad59df6f9ddf (patch)
tree237154928cff9c8da785d5ef2091ff5ff930f2c3 /src
parent6d3975f136ea15fa4390edccaa78b95adf1b85d9 (diff)
downloadpackages_apps_Browser-fe5b94d91cc026aa5e8e9476ed77ad59df6f9ddf.zip
packages_apps_Browser-fe5b94d91cc026aa5e8e9476ed77ad59df6f9ddf.tar.gz
packages_apps_Browser-fe5b94d91cc026aa5e8e9476ed77ad59df6f9ddf.tar.bz2
Don't strip www from URLs
Bug: 5253063 As there is a technical difference between google.com and www.google.com, avoid stripping the www. from URLs. Some sites still require the www. to be present, and in those cases it leads to a confusing experience if the www. is stripped Change-Id: Iacb5fdb148fc65c1f992339b463264e8cbf100e2
Diffstat (limited to 'src')
-rw-r--r--src/com/android/browser/UrlUtils.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/browser/UrlUtils.java b/src/com/android/browser/UrlUtils.java
index 681b242..e24000c 100644
--- a/src/com/android/browser/UrlUtils.java
+++ b/src/com/android/browser/UrlUtils.java
@@ -40,22 +40,22 @@ public class UrlUtils {
private final static String QUICKSEARCH_G = "http://www.google.com/m?q=%s";
private final static String QUERY_PLACE_HOLDER = "%s";
- // Regular expression to strip http://, optionally www., and optionally
+ // Regular expression to strip http:// and optionally
// the trailing slash
private static final Pattern STRIP_URL_PATTERN =
- Pattern.compile("^http://(?:www\\.)?(.*?)/?$");
+ Pattern.compile("^http://(.*?)/?$");
private UrlUtils() { /* cannot be instantiated */ }
/**
- * Strips the provided url of preceding "http://", "www.", and any trailing "/". Does not
+ * Strips the provided url of preceding "http://" and any trailing "/". Does not
* strip "https://". If the provided string cannot be stripped, the original string
* is returned.
*
* TODO: Put this in TextUtils to be used by other packages doing something similar.
*
* @param url a url to strip, like "http://www.google.com/"
- * @return a stripped url like "google.com", or the original string if it could
+ * @return a stripped url like "www.google.com", or the original string if it could
* not be stripped
*/
public static String stripUrl(String url) {