diff options
| author | Leon Scroggins <scroggo@google.com> | 2009-05-21 16:13:04 -0700 |
|---|---|---|
| committer | Leon Scroggins <scroggo@google.com> | 2009-05-21 16:13:04 -0700 |
| commit | e8708c2ecbd7bd739b69e6009f472886fee7035f (patch) | |
| tree | a0eba24c0ad4f9e9d4d37c383a7937d4057f73f3 /src/com/android/browser/AddBookmarkPage.java | |
| parent | 9343f6ae8f9e29ca8b1f45149fe5d86776d31cc3 (diff) | |
Fix an issue where bookmarking https: sites doesn't work.
Fix for issue 1863535. We were storing https:// sites in
the database without https:, so it was stored as a non
secure site. Then going back to that bookmark does not work.
Now, use the truncated url to compare, but store the original
url (with https at the beginning)
Diffstat (limited to 'src/com/android/browser/AddBookmarkPage.java')
| -rw-r--r-- | src/com/android/browser/AddBookmarkPage.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java index f773d062..74efdb81 100644 --- a/src/com/android/browser/AddBookmarkPage.java +++ b/src/com/android/browser/AddBookmarkPage.java @@ -160,24 +160,25 @@ public class AddBookmarkPage extends Activity { // how it's stored in the database, so allow different combos // to map to the same url. boolean secure = false; - if (url.startsWith("http://")) { - url = url.substring(7); - } else if (url.startsWith("https://")) { - url = url.substring(8); + String compareString = url; + if (compareString.startsWith("http://")) { + compareString = compareString.substring(7); + } else if (compareString.startsWith("https://")) { + compareString = compareString.substring(8); secure = true; } - if (url.startsWith("www.")) { - url = url.substring(4); + if (compareString.startsWith("www.")) { + compareString = compareString.substring(4); } if (secure) { SELECTION_ARGS = new String[2]; - SELECTION_ARGS[0] = "https://" + url; - SELECTION_ARGS[1] = "https://www." + url; + SELECTION_ARGS[0] = "https://" + compareString; + SELECTION_ARGS[1] = "https://www." + compareString; } else { SELECTION_ARGS = new String[4]; - SELECTION_ARGS[0] = url; - SELECTION_ARGS[1] = "www." + url; - SELECTION_ARGS[2] = "http://" + url; + SELECTION_ARGS[0] = compareString; + SELECTION_ARGS[1] = "www." + compareString; + SELECTION_ARGS[2] = "http://" + compareString; SELECTION_ARGS[3] = "http://" + SELECTION_ARGS[1]; } ContentResolver cr = getContentResolver(); |
