[evolution-rss] Sanitize folder title and accept fixed maximum length



commit 8a06415f5606006ab6412b4ea5167dad4732cbdb
Author: Lucian Langa <lucilanga gnome org>
Date:   Sat Apr 16 14:38:48 2011 +0300

    Sanitize folder title and accept fixed maximum length

 src/rss-config-factory.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/rss-config-factory.c b/src/rss-config-factory.c
index a49fa2f..279e018 100644
--- a/src/rss-config-factory.c
+++ b/src/rss-config-factory.c
@@ -1715,6 +1715,7 @@ import_dialog_response(
 void
 import_one_feed(gchar *url, gchar *title, gchar *prefix)
 {
+	gchar *tmp;
 	add_feed *feed = g_new0(add_feed, 1);
 	feed->changed=0;
 	feed->add=1;
@@ -1722,7 +1723,14 @@ import_one_feed(gchar *url, gchar *title, gchar *prefix)
 	feed->validate = feed_validate;
 	feed->enabled = feed_enabled;
 	feed->feed_url = g_strdup(url);
-	feed->feed_name = decode_html_entities(title);
+	tmp = decode_html_entities(title);
+	if (strlen(tmp) > 40) {
+		gchar *t = tmp;
+		tmp = g_strndup(tmp, 40);
+		g_free(t);
+	}
+	feed->feed_name = sanitize_folder(tmp);
+	g_free(tmp);
 	feed->prefix = g_strdup(prefix);
 	rf->progress_bar = import_progress;
 	rf->progress_dialog = import_dialog;



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