summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2010-05-12 11:53:59 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-05-12 11:53:59 -0700
commitebe88546a7ef8f8a116f14b43c81759eda68357d (patch)
tree60daf2d2919e8f3e371d0125f62512c0e60094f7 /src/com/android
parent70a153b61fc7606e6bb4dd279013ba87804b86e6 (diff)
parent55e849a5904425a1a54887bbd2d08b0fc52a68d1 (diff)
downloadpackages_apps_Browser-ebe88546a7ef8f8a116f14b43c81759eda68357d.zip
packages_apps_Browser-ebe88546a7ef8f8a116f14b43c81759eda68357d.tar.gz
packages_apps_Browser-ebe88546a7ef8f8a116f14b43c81759eda68357d.tar.bz2
am 55e849a5: merge from open-source master
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/browser/Tab.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java
index b583dbc..b9942c0 100644
--- a/src/com/android/browser/Tab.java
+++ b/src/com/android/browser/Tab.java
@@ -960,6 +960,9 @@ class Tab {
} else if (url.startsWith("http://")) {
url = url.substring(4);
}
+ // Escape wildcards for LIKE operator.
+ url = url.replace("\\", "\\\\").replace("%", "\\%")
+ .replace("_", "\\_");
Cursor c = null;
try {
final ContentResolver cr
@@ -967,7 +970,7 @@ class Tab {
url = "%" + url;
String [] selArgs = new String[] { url };
String where = Browser.BookmarkColumns.URL
- + " LIKE ? AND "
+ + " LIKE ? ESCAPE '\\' AND "
+ Browser.BookmarkColumns.BOOKMARK + " = 0";
c = cr.query(Browser.BOOKMARKS_URI, new String[]
{ Browser.BookmarkColumns._ID }, where, selArgs,