[tracker] Fixed GB#619801 - We need SPARQL escaping for cases where we use g_file_info_get_display_name()



commit b88393608b911a471f9a065e2074c5dc75411e41
Author: Martyn Russell <martyn lanedo com>
Date:   Thu May 27 11:45:01 2010 +0100

    Fixed GB#619801 - We need SPARQL escaping for cases where we use g_file_info_get_display_name()
    
    This was partially broken by commit b724b6128124f53d8a4053674df7a19ffebe566b

 src/libtracker-miner/tracker-miner-fs.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-miner-fs.c b/src/libtracker-miner/tracker-miner-fs.c
index b6bc4c4..d1259a1 100644
--- a/src/libtracker-miner/tracker-miner-fs.c
+++ b/src/libtracker-miner/tracker-miner-fs.c
@@ -1657,6 +1657,7 @@ item_move (TrackerMinerFS *fs,
 	RecursiveMoveData move_data;
 	ProcessData *data;
 	gchar *source_iri;
+	gchar *display_name;
 	gboolean source_exists;
 
 	iri_cache_invalidate (fs, file);
@@ -1745,6 +1746,8 @@ item_move (TrackerMinerFS *fs,
 	                        "} ",
 	                        source_iri, source_iri, source_iri);
 
+	display_name = tracker_sparql_escape (g_file_info_get_display_name (file_info));
+
 	g_string_append_printf (sparql,
 	                        "INSERT INTO <%s> {"
 	                        "  <%s> nfo:fileName \"%s\" ; "
@@ -1752,9 +1755,11 @@ item_move (TrackerMinerFS *fs,
 	                        "       nie:isStoredAs <%s> "
 	                        "} ",
 	                        source_iri, source_iri,
-	                        g_file_info_get_display_name (file_info), uri,
+	                        display_name, uri,
 	                        source_iri);
 
+	g_free (display_name);
+
 	move_data.main_loop = g_main_loop_new (NULL, FALSE);
 	move_data.sparql = sparql;
 	move_data.source_uri = source_uri;



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