[grilo-plugins/wip/jfelder/tracker-update-escape: 5/5] tracker: Correctly escape strings on sparql updates
- From: Victor Toso <victortoso src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [grilo-plugins/wip/jfelder/tracker-update-escape: 5/5] tracker: Correctly escape strings on sparql updates
- Date: Thu, 30 Jan 2020 13:28:50 +0000 (UTC)
commit c33c1b188c4cf43a0aa10f4a750c6413694f4ae6
Author: Jean Felder <jfelder src gnome org>
Date: Sun Nov 24 18:00:52 2019 +0100
tracker: Correctly escape strings on sparql updates
When creating a sparql query, only the special characters need to be
escaped. However, g_strescape replaces the non-ascii characters with a
'\' followed by their octal representation. This results in a invalid
query when a string contains non-ascii characters.
Using tracker_sparql_escape_string function instead of g_strescape
fixes this issue.
src/tracker/grl-tracker-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/tracker/grl-tracker-utils.c b/src/tracker/grl-tracker-utils.c
index ed7fb324..14cea8af 100644
--- a/src/tracker/grl-tracker-utils.c
+++ b/src/tracker/grl-tracker-utils.c
@@ -550,7 +550,7 @@ gen_prop_insert_string (GString *gstr,
switch (type) {
case G_TYPE_STRING:
- tmp = g_strescape (grl_data_get_string (data, assoc->grl_key), NULL);
+ tmp = tracker_sparql_escape_string (grl_data_get_string (data, assoc->grl_key));
g_string_append_printf (gstr, "%s \"%s\"",
assoc->sparql_key_attr, tmp);
g_free (tmp);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]