[evolution-data-server] [EBookBackendSExp] Skip PHOTO attribute in "Any field contains" search



commit 70776abf29188263b19e832fc3b355253dfec917
Author: Milan Crha <mcrha redhat com>
Date:   Mon Jan 21 12:55:49 2019 +0100

    [EBookBackendSExp] Skip PHOTO attribute in "Any field contains" search
    
    The PHOTO attribute may contain a path (in a form of a URI), which points
    to user's home directory usually. Any search containing text from this
    path would pick the contact as matching, which is rather a false positive.

 src/addressbook/libedata-book/e-book-backend-sexp.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/addressbook/libedata-book/e-book-backend-sexp.c 
b/src/addressbook/libedata-book/e-book-backend-sexp.c
index d80c0d438..9a6ac712d 100644
--- a/src/addressbook/libedata-book/e-book-backend-sexp.c
+++ b/src/addressbook/libedata-book/e-book-backend-sexp.c
@@ -432,10 +432,10 @@ entry_compare (SearchContext *ctx,
                                saw_any = TRUE;
                                info = &prop_info_table[i];
 
-                               if (any_field && info->field_id == E_CONTACT_UID) {
-                                       /* We need to skip UID from any field contains search
-                                        * any-field search should be supported for the
-                                        * visible fields only.
+                               if (any_field && (info->field_id == E_CONTACT_UID ||
+                                   (info->prop_type == PROP_TYPE_LIST && g_strcmp0 (info->query_prop, 
"photo") == 0))) {
+                                       /* We need to skip UID and PHOTO from any field contains search
+                                        * any-field search should be supported for the visible fields only.
                                         */
                                        truth = FALSE;
                                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]