summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2009-05-21 16:13:04 -0700
committerLeon Scroggins <scroggo@google.com>2009-05-21 16:13:04 -0700
commite8708c2ecbd7bd739b69e6009f472886fee7035f (patch)
treea0eba24c0ad4f9e9d4d37c383a7937d4057f73f3 /src/com/android
parent9343f6ae8f9e29ca8b1f45149fe5d86776d31cc3 (diff)
downloadpackages_apps_Browser-e8708c2ecbd7bd739b69e6009f472886fee7035f.zip
packages_apps_Browser-e8708c2ecbd7bd739b69e6009f472886fee7035f.tar.gz
packages_apps_Browser-e8708c2ecbd7bd739b69e6009f472886fee7035f.tar.bz2
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')
-rw-r--r--src/com/android/browser/AddBookmarkPage.java23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/com/android/browser/AddBookmarkPage.java b/src/com/android/browser/AddBookmarkPage.java
index f773d06..74efdb8 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();