rhythmbox r6284 - in trunk: . podcast



Author: jmatthew
Date: Sun Apr 12 05:21:59 2009
New Revision: 6284
URL: http://svn.gnome.org/viewvc/rhythmbox?rev=6284&view=rev

Log:
2009-04-12  Jonathan Matthew  <jonathan d14n org>

	* podcast/rb-podcast-parse.c: (entry_parsed):
	Ignore podcast items with no URI or a URI without a valid scheme.
	Fixes #578398.


Modified:
   trunk/ChangeLog
   trunk/podcast/rb-podcast-parse.c

Modified: trunk/podcast/rb-podcast-parse.c
==============================================================================
--- trunk/podcast/rb-podcast-parse.c	(original)
+++ trunk/podcast/rb-podcast-parse.c	Sun Apr 12 05:21:59 2009
@@ -129,9 +129,24 @@
 {
 	RBPodcastChannel *channel = (RBPodcastChannel *) data;
 	RBPodcastItem *item;
+	char *scheme = NULL;
 
 	item = g_new0 (RBPodcastItem, 1);
 	g_hash_table_foreach (metadata, (GHFunc) entry_metadata_foreach, item);
+
+	/* make sure the item URI is at least URI-like */
+	if (item->url != NULL)
+		scheme = g_uri_parse_scheme (item->url);
+
+	if (scheme == NULL) {
+		rb_debug ("ignoring podcast entry from feed %s with no/invalid uri %s",
+			  channel->url,
+			  item->url ? item->url : "<null>");
+		rb_podcast_parse_item_free (item);
+		return;
+	}
+	g_free (scheme);
+
 	channel->posts = g_list_prepend (channel->posts, item);
 }
 



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