[tracker] Fixes NB#170915: tracker-search for snippet is resulting in errors
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] Fixes NB#170915: tracker-search for snippet is resulting in errors
- Date: Tue, 22 Jun 2010 07:45:16 +0000 (UTC)
commit eb4504314e46400ecb361b731d91f5b1cd583630
Author: Aleksander Morgado <aleksander lanedo com>
Date: Tue Jun 22 09:30:12 2010 +0200
Fixes NB#170915: tracker-search for snippet is resulting in errors
src/tracker-utils/tracker-search.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-utils/tracker-search.c b/src/tracker-utils/tracker-search.c
index 947f209..e29d092 100644
--- a/src/tracker-utils/tracker-search.c
+++ b/src/tracker-utils/tracker-search.c
@@ -161,7 +161,13 @@ get_fts_string (GStrv search_words,
len = g_strv_length (search_words);
for (i = 0; i < len; i++) {
- g_string_append (fts, search_words[i]);
+ gchar *escaped;
+
+ /* Properly escape the input string as it's going to be passed
+ * in a sparql query */
+ escaped = tracker_sparql_escape (search_words[i]);
+
+ g_string_append (fts, escaped);
if (i < len - 1) {
if (use_or_operator) {
@@ -170,6 +176,8 @@ get_fts_string (GStrv search_words,
g_string_append (fts, " ");
}
}
+
+ g_free (escaped);
}
return g_string_free (fts, FALSE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]