From c32b0da4e4e765a25ee66aef00a62b940af3d0e1 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Mon, 14 Feb 2011 13:03:30 +0000 Subject: [PATCH] background: Only accept URIs when creating items --- panels/background/cc-background-item.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/panels/background/cc-background-item.c b/panels/background/cc-background-item.c index c81ac91ae..288955e14 100644 --- a/panels/background/cc-background-item.c +++ b/panels/background/cc-background-item.c @@ -263,7 +263,6 @@ update_info (CcBackgroundItem *item, if (info != NULL) g_object_unref (info); - } gboolean @@ -322,10 +321,13 @@ _set_uri (CcBackgroundItem *item, const char *value) { g_free (item->priv->uri); - if (value && *value == '\0') + if (value && *value == '\0') { item->priv->uri = NULL; - else + } else { + if (value && strstr (value, "://") == NULL) + g_warning ("URI '%s' is invalid", value); item->priv->uri = g_strdup (value); + } } const char *