summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2009-09-10 13:34:44 -0400
committerCary Clark <cary@android.com>2009-09-10 17:09:49 -0400
commit652ff87f0905abd11f2fdb6cb4de7840985a0810 (patch)
tree86c6e35897c344ffffaa3dbe122cb23c96d1a62a /src/com/android/browser
parentfcbd1d9d88d0f7a97504ce4604553f46b5da6b7b (diff)
downloadpackages_apps_Browser-652ff87f0905abd11f2fdb6cb4de7840985a0810.tar.gz
packages_apps_Browser-652ff87f0905abd11f2fdb6cb4de7840985a0810.tar.bz2
packages_apps_Browser-652ff87f0905abd11f2fdb6cb4de7840985a0810.zip
allow mixed-case schemes in user-defined URLs
Adjust the scheme to all lower case before fixing the URL. This allows mixed-case entries in bookmarks to resolve to a conical lower case URL.
Diffstat (limited to 'src/com/android/browser')
-rw-r--r--src/com/android/browser/BrowserActivity.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index bff8d04c6..7e0db5668 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -747,6 +747,24 @@ public class BrowserActivity extends Activity
}
/* package */ static String fixUrl(String inUrl) {
+ // FIXME: Converting the url to lower case
+ // duplicates functionality in smartUrlFilter().
+ // However, changing all current callers of fixUrl to
+ // call smartUrlFilter in addition may have unwanted
+ // consequences, and is deferred for now.
+ int colon = inUrl.indexOf(':');
+ boolean allLower = true;
+ for (int index = 0; index < colon; index++) {
+ char ch = inUrl.charAt(index);
+ if (!Character.isLetter(ch)) {
+ break;
+ }
+ allLower &= Character.isLowerCase(ch);
+ if (index == colon - 1 && !allLower) {
+ inUrl = inUrl.substring(0, colon).toLowerCase()
+ + inUrl.substring(colon);
+ }
+ }
if (inUrl.startsWith("http://") || inUrl.startsWith("https://"))
return inUrl;
if (inUrl.startsWith("http:") ||