aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfiaxh <github@lightrise.org>2016-04-04 17:42:21 +0200
committerfiaxh <github@lightrise.org>2016-04-12 11:49:48 +0200
commit2d73b74dde85f67b4302606938fdcc708bafc4c0 (patch)
treec6949765da81905e32ac1afd2645c4bcd38f99cf
parentf98279bc7002a0cb1ca073cd1c57a36b8b491211 (diff)
downloadopen-keychain-2d73b74dde85f67b4302606938fdcc708bafc4c0.tar.gz
open-keychain-2d73b74dde85f67b4302606938fdcc708bafc4c0.tar.bz2
open-keychain-2d73b74dde85f67b4302606938fdcc708bafc4c0.zip
Use email field to match email in KeychainProvider
fixes #1699
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java
index 9c5d0c054..8a5d09d7b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/provider/KeychainProvider.java
@@ -456,12 +456,12 @@ public class KeychainProvider extends ContentProvider {
if (i != 0) {
emailWhere += " OR ";
}
- emailWhere += "tmp." + UserPackets.USER_ID + " LIKE ";
- // match '*<email>', so it has to be at the *end* of the user id
if (match == KEY_RINGS_FIND_BY_EMAIL) {
- emailWhere += DatabaseUtils.sqlEscapeString("%<" + chunks[i] + ">");
+ emailWhere += "tmp." + UserPackets.EMAIL + " LIKE "
+ + DatabaseUtils.sqlEscapeString(chunks[i]);
} else {
- emailWhere += DatabaseUtils.sqlEscapeString("%" + chunks[i] + "%");
+ emailWhere += "tmp." + UserPackets.USER_ID + " LIKE "
+ + DatabaseUtils.sqlEscapeString("%" + chunks[i] + "%");
}
gotCondition = true;
}